Struct cranelift_codegen::flowgraph::ControlFlowGraph[][src]

pub struct ControlFlowGraph { /* fields omitted */ }
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

impl ControlFlowGraph[src]

pub fn new() -> Self[src]

Allocate a new blank control flow graph.

pub fn clear(&mut self)[src]

Clear all data structures in this control flow graph.

pub fn with_function(func: &Function) -> Self[src]

Allocate and compute the control flow graph for func.

pub fn compute(&mut self, func: &Function)[src]

Compute the control flow graph of func.

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

pub fn recompute_block(&mut self, func: &Function, block: Block)[src]

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.

pub fn pred_iter(&self, block: Block) -> PredIter<'_>

Notable traits for PredIter<'a>

impl<'a> Iterator for PredIter<'a> type Item = BlockPredecessor;
[src]

Get an iterator over the CFG predecessors to block.

pub fn succ_iter(&self, block: Block) -> SuccIter<'_>[src]

Get an iterator over the CFG successors to block.

pub fn is_valid(&self) -> bool[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.