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

The Control Flow Graph maintains a mapping of blocks to their predecessors and successors where predecessors are basic blocks and successors are basic blocks.

Implementations§

Allocate a new blank control flow graph.

Clear all data structures in this control flow graph.

Allocate and compute the control flow graph for func.

Compute the control flow graph of func.

This will clear and overwrite any information already stored in this data structure.

Recompute the control flow graph of block.

This is for use after modifying instructions within a specific block. It recomputes all edges from block while leaving edges to block intact. Its functionality a subset of that of the more expensive compute, and should be used when we know we don’t need to recompute the CFG from scratch, but rather that our changes have been restricted to specific blocks.

Get an iterator over the CFG predecessors to block.

Get an iterator over the CFG successors to block.

Check if the CFG 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 CFG is consistent with the function.

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.