pub trait DataFlowAnalysis: Analysis {
// Required methods
fn get_fn_dataflow(&self, def_id: DefId) -> Option<DataFlowGraph>;
fn get_all_dataflow(&self) -> DataFlowGraphMap;
fn has_flow_between(
&self,
def_id: DefId,
local1: Local,
local2: Local,
) -> bool;
fn collect_equivalent_locals(
&self,
def_id: DefId,
local: Local,
) -> HashSet<Local>;
fn get_fn_arg2ret(&self, def_id: DefId) -> Arg2Ret;
fn get_all_arg2ret(&self) -> Arg2RetMap;
}
Expand description
This trait provides features related to dataflow analysis.
Required Methods§
Sourcefn get_fn_dataflow(&self, def_id: DefId) -> Option<DataFlowGraph>
fn get_fn_dataflow(&self, def_id: DefId) -> Option<DataFlowGraph>
The function returns the dataflow graph for the given function id.
Sourcefn get_all_dataflow(&self) -> DataFlowGraphMap
fn get_all_dataflow(&self) -> DataFlowGraphMap
The function returns the dataflow graph for all functions.
Sourcefn has_flow_between(&self, def_id: DefId, local1: Local, local2: Local) -> bool
fn has_flow_between(&self, def_id: DefId, local1: Local, local2: Local) -> bool
If there is a dataflow between local1
and local2
within the function specified by
def_id
, the function returns ture; otherwise, it returns false.
Sourcefn collect_equivalent_locals(
&self,
def_id: DefId,
local: Local,
) -> HashSet<Local>
fn collect_equivalent_locals( &self, def_id: DefId, local: Local, ) -> HashSet<Local>
The function returns a set of Locals that are equivelent to the given local
.
Sourcefn get_fn_arg2ret(&self, def_id: DefId) -> Arg2Ret
fn get_fn_arg2ret(&self, def_id: DefId) -> Arg2Ret
The function returns an IndexVec of whether the returned Local depends on the parameter Local.
Sourcefn get_all_arg2ret(&self) -> Arg2RetMap
fn get_all_arg2ret(&self) -> Arg2RetMap
The function returns the dataflow between the arguments and return value for all functions