Struct cranelift_codegen::flowgraph::ControlFlowGraph [−][src]
pub struct ControlFlowGraph { /* fields omitted */ }
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.
Methods
impl ControlFlowGraph
[src]
impl ControlFlowGraph
pub fn new() -> Self
[src]
pub fn new() -> Self
Allocate a new blank control flow graph.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear all data structures in this control flow graph.
pub fn with_function(func: &Function) -> Self
[src]
pub fn with_function(func: &Function) -> Self
Allocate and compute the control flow graph for func
.
pub fn compute(&mut self, func: &Function)
[src]
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.
pub fn recompute_ebb(&mut self, func: &Function, ebb: Ebb)
[src]
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.
ⓘImportant traits for PredIter<'a>pub fn pred_iter(&self, ebb: Ebb) -> PredIter
[src]
pub fn pred_iter(&self, ebb: Ebb) -> PredIter
Get an iterator over the CFG predecessors to ebb
.
pub fn succ_iter(&self, ebb: Ebb) -> SuccIter
[src]
pub fn succ_iter(&self, ebb: Ebb) -> SuccIter
Get an iterator over the CFG successors to ebb
.
pub fn is_valid(&self) -> bool
[src]
pub fn is_valid(&self) -> bool
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
impl Send for ControlFlowGraph
impl Send for ControlFlowGraph
impl Sync for ControlFlowGraph
impl Sync for ControlFlowGraph