pub struct DataFlowGraph { /* private fields */ }Expand description
DataFlowGraph provides data flow analysis capabilities built on top of the CallGraph. It tracks variable dependencies, data transformations, and information flow between functions.
Implementations§
Source§impl DataFlowGraph
impl DataFlowGraph
pub fn new() -> Self
Sourcepub fn from_call_graph(call_graph: CallGraph) -> Self
pub fn from_call_graph(call_graph: CallGraph) -> Self
Create a DataFlowGraph from an existing CallGraph
Sourcepub fn call_graph(&self) -> &CallGraph
pub fn call_graph(&self) -> &CallGraph
Get the underlying call graph
Sourcepub fn get_variable_dependencies(
&self,
func_id: &FunctionId,
) -> Option<&HashSet<String>>
pub fn get_variable_dependencies( &self, func_id: &FunctionId, ) -> Option<&HashSet<String>>
Get variable dependencies for a function
Sourcepub fn add_variable_dependencies(
&mut self,
func_id: FunctionId,
variables: HashSet<String>,
)
pub fn add_variable_dependencies( &mut self, func_id: FunctionId, variables: HashSet<String>, )
Add variable dependencies for a function
Sourcepub fn get_data_transformation(
&self,
from: &FunctionId,
to: &FunctionId,
) -> Option<&DataTransformation>
pub fn get_data_transformation( &self, from: &FunctionId, to: &FunctionId, ) -> Option<&DataTransformation>
Get data transformation between two functions
Sourcepub fn add_data_transformation(
&mut self,
from: FunctionId,
to: FunctionId,
transformation: DataTransformation,
)
pub fn add_data_transformation( &mut self, from: FunctionId, to: FunctionId, transformation: DataTransformation, )
Add data transformation between two functions
Sourcepub fn get_io_operations(
&self,
func_id: &FunctionId,
) -> Option<&Vec<IoOperation>>
pub fn get_io_operations( &self, func_id: &FunctionId, ) -> Option<&Vec<IoOperation>>
Get I/O operations for a function
Sourcepub fn add_io_operation(&mut self, func_id: FunctionId, operation: IoOperation)
pub fn add_io_operation(&mut self, func_id: FunctionId, operation: IoOperation)
Add I/O operation for a function
Sourcepub fn get_purity_info(&self, func_id: &FunctionId) -> Option<&PurityInfo>
pub fn get_purity_info(&self, func_id: &FunctionId) -> Option<&PurityInfo>
Get purity information for a function
Sourcepub fn set_purity_info(&mut self, func_id: FunctionId, purity: PurityInfo)
pub fn set_purity_info(&mut self, func_id: FunctionId, purity: PurityInfo)
Set purity information for a function
Sourcepub fn get_cfg_analysis(
&self,
func_id: &FunctionId,
) -> Option<&DataFlowAnalysis>
pub fn get_cfg_analysis( &self, func_id: &FunctionId, ) -> Option<&DataFlowAnalysis>
Get CFG-based data flow analysis for a function
Sourcepub fn set_cfg_analysis(
&mut self,
func_id: FunctionId,
analysis: DataFlowAnalysis,
)
pub fn set_cfg_analysis( &mut self, func_id: FunctionId, analysis: DataFlowAnalysis, )
Set CFG-based data flow analysis for a function
Sourcepub fn get_mutation_info(&self, func_id: &FunctionId) -> Option<&MutationInfo>
pub fn get_mutation_info(&self, func_id: &FunctionId) -> Option<&MutationInfo>
Get mutation analysis for a function
Sourcepub fn set_mutation_info(&mut self, func_id: FunctionId, info: MutationInfo)
pub fn set_mutation_info(&mut self, func_id: FunctionId, info: MutationInfo)
Set mutation analysis for a function
Sourcepub fn get_cfg_analysis_with_context(
&self,
func_id: &FunctionId,
) -> Option<&CfgAnalysisWithContext>
pub fn get_cfg_analysis_with_context( &self, func_id: &FunctionId, ) -> Option<&CfgAnalysisWithContext>
Get CFG analysis with translation context
Sourcepub fn set_cfg_analysis_with_context(
&mut self,
func_id: FunctionId,
context: CfgAnalysisWithContext,
)
pub fn set_cfg_analysis_with_context( &mut self, func_id: FunctionId, context: CfgAnalysisWithContext, )
Set CFG analysis with context
Sourcepub fn get_dead_store_names(&self, func_id: &FunctionId) -> Vec<String>
pub fn get_dead_store_names(&self, func_id: &FunctionId) -> Vec<String>
Get dead store variable names
Sourcepub fn get_escaping_var_names(&self, func_id: &FunctionId) -> Vec<String>
pub fn get_escaping_var_names(&self, func_id: &FunctionId) -> Vec<String>
Get escaping variable names
Sourcepub fn get_return_dependency_names(&self, func_id: &FunctionId) -> Vec<String>
pub fn get_return_dependency_names(&self, func_id: &FunctionId) -> Vec<String>
Get return dependency variable names
Sourcepub fn get_tainted_var_names(&self, func_id: &FunctionId) -> Vec<String>
pub fn get_tainted_var_names(&self, func_id: &FunctionId) -> Vec<String>
Get tainted variable names
Sourcepub fn has_side_effects(&self, func_id: &FunctionId) -> bool
pub fn has_side_effects(&self, func_id: &FunctionId) -> bool
Check if a function has side effects based on data flow analysis
Sourcepub fn get_downstream_dependencies(
&self,
func_id: &FunctionId,
) -> Vec<FunctionId>
pub fn get_downstream_dependencies( &self, func_id: &FunctionId, ) -> Vec<FunctionId>
Get all functions that may be affected by changes to the given function
Sourcepub fn get_upstream_dependencies(
&self,
_func_id: &FunctionId,
) -> Vec<FunctionId>
pub fn get_upstream_dependencies( &self, _func_id: &FunctionId, ) -> Vec<FunctionId>
Get all functions that the given function depends on
Sourcepub fn analyze_modification_impact(
&self,
func_id: &FunctionId,
) -> ModificationImpact
pub fn analyze_modification_impact( &self, func_id: &FunctionId, ) -> ModificationImpact
Analyze the data flow impact of modifying a function
Trait Implementations§
Source§impl Clone for DataFlowGraph
impl Clone for DataFlowGraph
Source§fn clone(&self) -> DataFlowGraph
fn clone(&self) -> DataFlowGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataFlowGraph
impl Debug for DataFlowGraph
Source§impl Default for DataFlowGraph
impl Default for DataFlowGraph
Source§impl<'de> Deserialize<'de> for DataFlowGraph
impl<'de> Deserialize<'de> for DataFlowGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DataFlowGraph
impl RefUnwindSafe for DataFlowGraph
impl Send for DataFlowGraph
impl Sync for DataFlowGraph
impl Unpin for DataFlowGraph
impl UnwindSafe for DataFlowGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more