[][src]Struct ssa::cfg::Graph

pub struct Graph<'a> { /* fields omitted */ }

Process AST tree

This module reads AST tree and preprocess data for ControlFlowGraph, Graph separates a function call to 2 blocks by calling build_block.

  • Param
  • Body

For body, Graph calls build_items to find control flow tokens. For each token, Graph calls build_node to find its components

It is noted that, Graph start at build_node with NodeKind::Root

Methods

impl<'a> Graph<'a>[src]

pub fn new(walker: Walker<'a>) -> Self[src]

pub fn split(walker: Walker<'a>) -> Vec<SimpleBlockNode<'a>>[src]

Find all nested function_calls and try to create a single node for each

Some functions directly affect to control flow will be collected to precisely build cfg

pub fn build_items(&mut self, walker: Walker<'a>) -> Vec<CodeBlock<'a>>[src]

Traverse the body of a function based on token kind, for some special token call build_node to find it's components

pub fn build_block(
    &mut self,
    kind: BlockKind,
    walker: Walker<'a>
) -> Vec<CodeBlock<'a>>
[src]

Traverse parameter list and modifier invocations, call build_items to traverse body of a function

pub fn build_node(
    &mut self,
    kind: NodeKind,
    walker: Walker<'a>
) -> BlockNode<'a>
[src]

For each node, try to detect it's components

pub fn update(&mut self) -> &BlockNode[src]

Trait Implementations

impl<'a> Debug for Graph<'a>[src]

Auto Trait Implementations

impl<'a> Send for Graph<'a>

impl<'a> Sync for Graph<'a>

Blanket Implementations

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

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

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.

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.

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

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

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