Add a Layout::next_ebb() method.
This lets us iterate over the blocks in a function without holding a reference to the layout.
This commit is contained in:
@@ -348,6 +348,11 @@ impl Layout {
|
||||
pub fn entry_block(&self) -> Option<Ebb> {
|
||||
self.first_ebb
|
||||
}
|
||||
|
||||
/// Get the block following `ebb` in the layout order.
|
||||
pub fn next_ebb(&self, ebb: Ebb) -> Option<Ebb> {
|
||||
self.ebbs[ebb].next.expand()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
|
||||
Reference in New Issue
Block a user