pub struct LoopInfo {
pub loops: Vec<NaturalLoop>,
pub back_edges: Vec<(BlockId, BlockId)>,
pub block_depth: HashMap<BlockId, u32>,
}Expand description
Result of loop analysis.
Fields§
§loops: Vec<NaturalLoop>Detected natural loops.
back_edges: Vec<(BlockId, BlockId)>Back edges in the CFG.
block_depth: HashMap<BlockId, u32>Loop depth for each block (0 if not in any loop).
Implementations§
Source§impl LoopInfo
impl LoopInfo
Sourcepub fn compute(cfg: &Cfg, dom: &DomTree) -> Self
pub fn compute(cfg: &Cfg, dom: &DomTree) -> Self
Perform loop analysis on a CFG with dominator tree.
Sourcepub fn depth(&self, block: BlockId) -> u32
pub fn depth(&self, block: BlockId) -> u32
Returns the loop depth of a block (0 if not in any loop).
Sourcepub fn containing_loop(&self, block: BlockId) -> Option<&NaturalLoop>
pub fn containing_loop(&self, block: BlockId) -> Option<&NaturalLoop>
Returns the innermost loop containing a block, if any.
Auto Trait Implementations§
impl Freeze for LoopInfo
impl RefUnwindSafe for LoopInfo
impl Send for LoopInfo
impl Sync for LoopInfo
impl Unpin for LoopInfo
impl UnsafeUnpin for LoopInfo
impl UnwindSafe for LoopInfo
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