Rename lifetimes in layout.rs to 'f

These lifetimes all represent the lifetime of the Function.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-19 16:23:08 -07:00
parent cba5cdd22e
commit c8f28e5902

View File

@@ -123,7 +123,7 @@ impl Layout {
} }
/// Return an iterator over all EBBs in layout order. /// Return an iterator over all EBBs in layout order.
pub fn ebbs<'a>(&'a self) -> Ebbs<'a> { pub fn ebbs<'f>(&'f self) -> Ebbs<'f> {
Ebbs { Ebbs {
layout: self, layout: self,
next: self.first_ebb, next: self.first_ebb,
@@ -146,12 +146,12 @@ struct EbbNode {
} }
/// Iterate over EBBs in layout order. See `Layout::ebbs()`. /// Iterate over EBBs in layout order. See `Layout::ebbs()`.
pub struct Ebbs<'a> { pub struct Ebbs<'f> {
layout: &'a Layout, layout: &'f Layout,
next: Option<Ebb>, next: Option<Ebb>,
} }
impl<'a> Iterator for Ebbs<'a> { impl<'f> Iterator for Ebbs<'f> {
type Item = Ebb; type Item = Ebb;
fn next(&mut self) -> Option<Ebb> { fn next(&mut self) -> Option<Ebb> {
@@ -166,11 +166,11 @@ impl<'a> Iterator for Ebbs<'a> {
} }
/// Use a layout reference in a for loop. /// Use a layout reference in a for loop.
impl<'a> IntoIterator for &'a Layout { impl<'f> IntoIterator for &'f Layout {
type Item = Ebb; type Item = Ebb;
type IntoIter = Ebbs<'a>; type IntoIter = Ebbs<'f>;
fn into_iter(self) -> Ebbs<'a> { fn into_iter(self) -> Ebbs<'f> {
self.ebbs() self.ebbs()
} }
} }
@@ -235,7 +235,7 @@ impl Layout {
} }
/// Iterate over the instructions in `ebb` in layout order. /// Iterate over the instructions in `ebb` in layout order.
pub fn ebb_insts<'a>(&'a self, ebb: Ebb) -> Insts<'a> { pub fn ebb_insts<'f>(&'f self, ebb: Ebb) -> Insts<'f> {
Insts { Insts {
layout: self, layout: self,
next: self.ebbs[ebb].first_inst.wrap(), next: self.ebbs[ebb].first_inst.wrap(),
@@ -316,12 +316,12 @@ struct InstNode {
} }
/// Iterate over instructions in an EBB in layout order. See `Layout::ebb_insts()`. /// Iterate over instructions in an EBB in layout order. See `Layout::ebb_insts()`.
pub struct Insts<'a> { pub struct Insts<'f> {
layout: &'a Layout, layout: &'f Layout,
next: Option<Inst>, next: Option<Inst>,
} }
impl<'a> Iterator for Insts<'a> { impl<'f> Iterator for Insts<'f> {
type Item = Inst; type Item = Inst;
fn next(&mut self) -> Option<Inst> { fn next(&mut self) -> Option<Inst> {
@@ -345,8 +345,8 @@ impl<'a> Iterator for Insts<'a> {
/// ///
/// When new instructions are added, the cursor can either apend them to an EBB or insert them /// When new instructions are added, the cursor can either apend them to an EBB or insert them
/// before the current instruction. /// before the current instruction.
pub struct Cursor<'a> { pub struct Cursor<'f> {
layout: &'a mut Layout, layout: &'f mut Layout,
pos: CursorPosition, pos: CursorPosition,
} }
@@ -366,10 +366,10 @@ pub enum CursorPosition {
After(Ebb), After(Ebb),
} }
impl<'a> Cursor<'a> { impl<'f> Cursor<'f> {
/// Create a new `Cursor` for `layout`. /// Create a new `Cursor` for `layout`.
/// The cursor holds a mutable reference to `layout` for its entire lifetime. /// The cursor holds a mutable reference to `layout` for its entire lifetime.
pub fn new(layout: &'a mut Layout) -> Cursor { pub fn new(layout: &'f mut Layout) -> Cursor {
Cursor { Cursor {
layout: layout, layout: layout,
pos: CursorPosition::Nowhere, pos: CursorPosition::Nowhere,