pub struct LoopTree { /* private fields */ }
Implementations§
Source§impl LoopTree
impl LoopTree
pub fn compute(cfg: &ControlFlowGraph, domtree: &DomTree) -> Self
Sourcepub fn iter_blocks_post_order<'a, 'b>(
&'a self,
cfg: &'b ControlFlowGraph,
lp: LoopId,
) -> BlocksInLoopPostOrder<'a, 'b> ⓘ
pub fn iter_blocks_post_order<'a, 'b>( &'a self, cfg: &'b ControlFlowGraph, lp: LoopId, ) -> BlocksInLoopPostOrder<'a, 'b> ⓘ
Returns all blocks in the loop.
Sourcepub fn loops(&self) -> impl Iterator<Item = LoopId> + '_
pub fn loops(&self) -> impl Iterator<Item = LoopId> + '_
Returns all loops in a function body. An outer loop is guaranteed to be iterated before its inner loops.
Sourcepub fn is_block_in_loop(&self, block: BasicBlockId, lp: LoopId) -> bool
pub fn is_block_in_loop(&self, block: BasicBlockId, lp: LoopId) -> bool
Returns true
if the block
is in the lp
.
Sourcepub fn loop_header(&self, lp: LoopId) -> BasicBlockId
pub fn loop_header(&self, lp: LoopId) -> BasicBlockId
Returns header block of the lp
.
Sourcepub fn parent_loop(&self, lp: LoopId) -> Option<LoopId>
pub fn parent_loop(&self, lp: LoopId) -> Option<LoopId>
Get parent loop of the lp
if exists.
Sourcepub fn loop_of_block(&self, block: BasicBlockId) -> Option<LoopId>
pub fn loop_of_block(&self, block: BasicBlockId) -> Option<LoopId>
Returns the loop that the block
belongs to.
If the block
belongs to multiple loops, then returns the innermost
loop.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoopTree
impl RefUnwindSafe for LoopTree
impl Send for LoopTree
impl Sync for LoopTree
impl Unpin for LoopTree
impl UnwindSafe for LoopTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more