DataFlowGraph

Struct DataFlowGraph 

Source
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

Source

pub fn new() -> Self

Source

pub fn from_call_graph(call_graph: CallGraph) -> Self

Create a DataFlowGraph from an existing CallGraph

Source

pub fn call_graph(&self) -> &CallGraph

Get the underlying call graph

Source

pub fn get_variable_dependencies( &self, func_id: &FunctionId, ) -> Option<&HashSet<String>>

Get variable dependencies for a function

Source

pub fn add_variable_dependencies( &mut self, func_id: FunctionId, variables: HashSet<String>, )

Add variable dependencies for a function

Source

pub fn get_data_transformation( &self, from: &FunctionId, to: &FunctionId, ) -> Option<&DataTransformation>

Get data transformation between two functions

Source

pub fn add_data_transformation( &mut self, from: FunctionId, to: FunctionId, transformation: DataTransformation, )

Add data transformation between two functions

Source

pub fn get_io_operations( &self, func_id: &FunctionId, ) -> Option<&Vec<IoOperation>>

Get I/O operations for a function

Source

pub fn add_io_operation(&mut self, func_id: FunctionId, operation: IoOperation)

Add I/O operation for a function

Source

pub fn get_purity_info(&self, func_id: &FunctionId) -> Option<&PurityInfo>

Get purity information for a function

Source

pub fn set_purity_info(&mut self, func_id: FunctionId, purity: PurityInfo)

Set purity information for a function

Source

pub fn get_cfg_analysis( &self, func_id: &FunctionId, ) -> Option<&DataFlowAnalysis>

Get CFG-based data flow analysis for a function

Source

pub fn set_cfg_analysis( &mut self, func_id: FunctionId, analysis: DataFlowAnalysis, )

Set CFG-based data flow analysis for a function

Source

pub fn get_mutation_info(&self, func_id: &FunctionId) -> Option<&MutationInfo>

Get mutation analysis for a function

Source

pub fn set_mutation_info(&mut self, func_id: FunctionId, info: MutationInfo)

Set mutation analysis for a function

Source

pub fn get_cfg_analysis_with_context( &self, func_id: &FunctionId, ) -> Option<&CfgAnalysisWithContext>

Get CFG analysis with translation context

Source

pub fn set_cfg_analysis_with_context( &mut self, func_id: FunctionId, context: CfgAnalysisWithContext, )

Set CFG analysis with context

Source

pub fn get_dead_store_names(&self, func_id: &FunctionId) -> Vec<String>

Get dead store variable names

Source

pub fn get_escaping_var_names(&self, func_id: &FunctionId) -> Vec<String>

Get escaping variable names

Source

pub fn get_return_dependency_names(&self, func_id: &FunctionId) -> Vec<String>

Get return dependency variable names

Source

pub fn get_tainted_var_names(&self, func_id: &FunctionId) -> Vec<String>

Get tainted variable names

Source

pub fn has_side_effects(&self, func_id: &FunctionId) -> bool

Check if a function has side effects based on data flow analysis

Source

pub fn get_downstream_dependencies( &self, func_id: &FunctionId, ) -> Vec<FunctionId>

Get all functions that may be affected by changes to the given function

Source

pub fn get_upstream_dependencies( &self, _func_id: &FunctionId, ) -> Vec<FunctionId>

Get all functions that the given function depends on

Source

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

Source§

fn clone(&self) -> DataFlowGraph

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataFlowGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DataFlowGraph

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DataFlowGraph

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DataFlowGraph

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,