pub struct NaturalLoop {
pub header: NodeIndex,
pub back_edge: (NodeIndex, NodeIndex),
pub body: HashSet<NodeIndex>,
}Expand description
A natural loop detected in the CFG
A natural loop has a single entry point (the header) and is identified by a back-edge where the header dominates the tail.
Fields§
§header: NodeIndexLoop header node (single entry point)
back_edge: (NodeIndex, NodeIndex)Back edge (tail -> header) that identifies this loop
body: HashSet<NodeIndex>All nodes in the loop body (including header)
Implementations§
Source§impl NaturalLoop
impl NaturalLoop
Sourcepub fn nesting_level(&self, all_loops: &[NaturalLoop]) -> usize
pub fn nesting_level(&self, all_loops: &[NaturalLoop]) -> usize
Get the loop depth (nesting level) relative to other loops
Returns 0 for outermost loops, 1 for loops nested inside one outer loop, etc.
Trait Implementations§
Source§impl Clone for NaturalLoop
impl Clone for NaturalLoop
Source§fn clone(&self) -> NaturalLoop
fn clone(&self) -> NaturalLoop
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NaturalLoop
impl RefUnwindSafe for NaturalLoop
impl Send for NaturalLoop
impl Sync for NaturalLoop
impl Unpin for NaturalLoop
impl UnsafeUnpin for NaturalLoop
impl UnwindSafe for NaturalLoop
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more