pub struct LoopAnalysis { /* private fields */ }
Expand description

Loop tree information for a single function.

Loops are referenced by the Loop object, and for each loop you can access its header block, its eventual parent in the loop tree and all the block belonging to the loop.

Implementations

Methods for querying the loop analysis.

Allocate a new blank loop analysis struct. Use compute to compute the loop analysis for a function.

Returns all the loops contained in a function.

Returns the header block of a particular loop.

The characteristic property of a loop header block is that it dominates some of its predecessors.

Return the eventual parent of a loop in the loop tree.

Determine if a Block belongs to a loop by running a finger along the loop tree.

Returns true if block is in loop lp.

Determines if a loop is contained in another loop.

is_child_loop(child,parent) returns true if and only if child is a child loop of parent (or child == parent).

Detects the loops in a function. Needs the control flow graph and the dominator tree.

Check if the loop analysis is in a valid state.

Note that this doesn’t perform any kind of validity checks. It simply checks if the compute() method has been called since the last clear(). It does not check that the loop analysis is consistent with the CFG.

Clear all the data structures contained in the loop analysis. This will leave the analysis in a similar state to a context returned by new() except that allocated memory be retained.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.