pub struct LoopInfo { /* private fields */ }Expand description
Loop nesting information for a single function.
Implementations§
Source§impl LoopInfo
impl LoopInfo
Sourcepub fn compute(func: &Function, cfg: &Cfg, dom: &DomTree) -> Self
pub fn compute(func: &Function, cfg: &Cfg, dom: &DomTree) -> Self
Detect all natural loops in func.
Uses the standard back-edge + reverse-CFG-BFS algorithm, which is correct only for reducible CFGs. On an irreducible CFG, cycles whose strongly-connected component has no single dominating header will not be reported. See the module-level documentation for details and mitigation options.
Sourcepub fn loop_of(&self, bid: BlockId) -> Option<usize>
pub fn loop_of(&self, bid: BlockId) -> Option<usize>
Index of the innermost loop containing bid, or None.
Sourcepub fn is_loop_header(&self, bid: BlockId) -> bool
pub fn is_loop_header(&self, bid: BlockId) -> bool
true if bid is the header of any detected loop.
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