Struct cranelift_codegen::flowgraph::ControlFlowGraph
source · pub struct ControlFlowGraph { /* private fields */ }
Expand description
The Control Flow Graph maintains a mapping of ebbs to their predecessors and successors where predecessors are basic blocks and successors are extended basic blocks.
Implementations§
source§impl 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_ebb(&mut self, func: &Function, ebb: Ebb)
pub fn recompute_ebb(&mut self, func: &Function, ebb: Ebb)
Recompute the control flow graph of ebb
.
This is for use after modifying instructions within a specific EBB. It recomputes all edges
from ebb
while leaving edges to ebb
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 EBBs.
sourcepub fn pred_iter(&self, ebb: Ebb) -> PredIter<'_> ⓘ
pub fn pred_iter(&self, ebb: Ebb) -> PredIter<'_> ⓘ
Get an iterator over the CFG predecessors to ebb
.