Struct cranelift_codegen::flowgraph::ControlFlowGraph
source · [−]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
sourceimpl ControlFlowGraph
impl ControlFlowGraph
sourcepub fn with_function(func: &Function) -> Self
pub fn with_function(func: &Function) -> Self
Allocate and compute the control flow graph for func
.
sourcepub fn compute(&mut self, func: &Function)
pub fn compute(&mut self, func: &Function)
Compute the control flow graph of func
.
This will clear and overwrite any information already stored in this data structure.
sourcepub fn recompute_block(&mut self, func: &Function, block: Block)
pub fn recompute_block(&mut self, func: &Function, block: Block)
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.
sourcepub fn pred_iter(&self, block: Block) -> PredIter<'_>ⓘNotable traits for PredIter<'a>impl<'a> Iterator for PredIter<'a> type Item = BlockPredecessor;
pub fn pred_iter(&self, block: Block) -> PredIter<'_>ⓘNotable traits for PredIter<'a>impl<'a> Iterator for PredIter<'a> type Item = BlockPredecessor;
Get an iterator over the CFG predecessors to block
.
Auto Trait Implementations
impl RefUnwindSafe for ControlFlowGraph
impl Send for ControlFlowGraph
impl Sync for ControlFlowGraph
impl Unpin for ControlFlowGraph
impl UnwindSafe for ControlFlowGraph
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more