pub struct LoopTree { /* private fields */ }Implementations§
Source§impl LoopTree
impl LoopTree
pub fn new() -> Self
Sourcepub fn compute(&mut self, cfg: &ControlFlowGraph, domtree: &DomTree)
pub fn compute(&mut self, cfg: &ControlFlowGraph, domtree: &DomTree)
Compute the LoopTree of the block.
Sourcepub fn loops(&self) -> impl DoubleEndedIterator<Item = Loop>
pub fn loops(&self) -> impl DoubleEndedIterator<Item = Loop>
Returns all loops. The result iterator guarantees outer loops are returned before its inner loops.
Sourcepub fn iter_blocks_post_order<'a, 'b>(
&'a self,
cfg: &'b ControlFlowGraph,
lp: Loop,
) -> BlocksInLoopPostOrder<'a, 'b> ⓘ
pub fn iter_blocks_post_order<'a, 'b>( &'a self, cfg: &'b ControlFlowGraph, lp: Loop, ) -> BlocksInLoopPostOrder<'a, 'b> ⓘ
Returns all blocks in the loop.
Sourcepub fn is_in_loop(&self, block: Block, lp: Loop) -> bool
pub fn is_in_loop(&self, block: Block, lp: Loop) -> bool
Returns true if the block is in the lp.
Sourcepub fn loop_header(&self, lp: Loop) -> Block
pub fn loop_header(&self, lp: Loop) -> Block
Returns header block of the lp.
Sourcepub fn parent_loop(&self, lp: Loop) -> Option<Loop>
pub fn parent_loop(&self, lp: Loop) -> Option<Loop>
Get parent loop of the lp if exists.
Sourcepub fn loop_of_block(&self, block: Block) -> Option<Loop>
pub fn loop_of_block(&self, block: Block) -> Option<Loop>
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