[][src]Struct c2rust_transpile::cfg::Cfg

pub struct Cfg<Lbl: Ord + Hash, Stmt> { /* fields omitted */ }

A CFG graph of regular basic blocks.

Methods

impl<L: Clone + Ord + Hash, S1> Cfg<L, S1>[src]

pub fn map_stmts<S2, F: Fn(&S1) -> S2>(&self, f: F) -> Cfg<L, S2>[src]

Produce a copy of the current CFG, but transform all of the statements using the function provided.

impl Cfg<Label, StmtOrDecl>[src]

A complete control-flow graph

pub fn from_stmts(
    translator: &Translation,
    ctx: ExprContext,
    stmt_ids: &[CStmtId],
    ret: ImplicitReturnType
) -> Result<(Self, DeclStmtStore), TranslationError>
[src]

Completely process a statement into a control flow graph.

impl<Lbl: Copy + Ord + Hash + Debug, Stmt> Cfg<Lbl, Stmt>[src]

The polymorphism here is only to make it clear exactly how little these functions need to know about the actual contents of the CFG - we only actual call these on one monomorphic CFG type.

pub fn prune_unreachable_blocks_mut(&mut self)[src]

Removes blocks that cannot be reached from the CFG

pub fn prune_empty_blocks_mut(&mut self)[src]

Removes empty blocks whose terminator is just a Jump by merging them with the block they are jumping to.

impl Cfg<Label, StmtOrDecl>[src]

This impl block deals with pretty-printing control flow graphs into a format that dot can consume. Compiling these files into images means running something like:

dot -Tpng cfg_func.dot > cfg_func.png

pub fn dump_json_graph(
    &self,
    store: &DeclStmtStore,
    file_path: String
) -> Result<()>
[src]

Write out a JSON representation of the control flow graph

pub fn dump_dot_graph(
    &self,
    ctx: &TypedAstContext,
    store: &DeclStmtStore,
    show_liveness: bool,
    show_loops: bool,
    file_path: String
) -> Result<()>
[src]

Write out a .dot representation of the control flow graph

Trait Implementations

impl<Lbl: Clone + Ord + Hash, Stmt: Clone> Clone for Cfg<Lbl, Stmt>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Lbl: Debug + Ord + Hash, Stmt: Debug> Debug for Cfg<Lbl, Stmt>[src]

impl<L: Serialize + Ord + Hash, St: Serialize> Serialize for Cfg<L, St>[src]

Auto Trait Implementations

impl<Lbl, Stmt> !Send for Cfg<Lbl, Stmt>

impl<Lbl, Stmt> !Sync for Cfg<Lbl, Stmt>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

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

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

impl<T> Make for T[src]

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T