[−][src]Struct ssa::cfg::Graph
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]
&mut self,
kind: BlockKind,
walker: Walker<'a>
) -> Vec<CodeBlock<'a>>
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]
&mut self,
kind: NodeKind,
walker: Walker<'a>
) -> BlockNode<'a>
For each node, try to detect it's components
pub fn update(&mut self) -> &BlockNode
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,