pub trait DataflowAnalysis: TransferFunctions {
fn analyze_function(
&self,
initial_state: Self::State,
instrs: &[Bytecode],
cfg: &StacklessControlFlowGraph
) -> StateMap<Self::State> { ... }
fn state_per_instruction<A, F>(
&self,
state_map: StateMap<Self::State>,
instrs: &[Bytecode],
cfg: &StacklessControlFlowGraph,
f: F
) -> BTreeMap<CodeOffset, A>
where
F: FnMut(&Self::State, &Self::State) -> A,
{ ... }
}
Provided Methods
fn analyze_function(
&self,
initial_state: Self::State,
instrs: &[Bytecode],
cfg: &StacklessControlFlowGraph
) -> StateMap<Self::State>
fn state_per_instruction<A, F>(
&self,
state_map: StateMap<Self::State>,
instrs: &[Bytecode],
cfg: &StacklessControlFlowGraph,
f: F
) -> BTreeMap<CodeOffset, A> where
F: FnMut(&Self::State, &Self::State) -> A,
fn state_per_instruction<A, F>(
&self,
state_map: StateMap<Self::State>,
instrs: &[Bytecode],
cfg: &StacklessControlFlowGraph,
f: F
) -> BTreeMap<CodeOffset, A> where
F: FnMut(&Self::State, &Self::State) -> A,
Takes the StateMap resulting from analyze_function
and converts it into a map
from each code offset into a derived state A
. This re-executes the analysis for
each instruction within a basic block to reconstruct the intermediate results
from block begin to block end. The function f
gets passed the before/after state
of the instruction at a code offset. Returns a map from code offset to A
.