DataFlowAnalyzer

Struct DataFlowAnalyzer 

Source
pub struct DataFlowAnalyzer<'tcx> {
    pub tcx: TyCtxt<'tcx>,
    pub graphs: HashMap<DefId, Graph>,
    pub debug: bool,
}

Fields§

§tcx: TyCtxt<'tcx>§graphs: HashMap<DefId, Graph>§debug: bool

Implementations§

Source§

impl<'tcx> DataFlowAnalyzer<'tcx>

Source

pub fn new(tcx: TyCtxt<'tcx>, debug: bool) -> Self

Source

pub fn start(&mut self)

Source

pub fn build_graphs(&mut self)

Source

pub fn build_graph(&mut self, def_id: DefId)

Source

pub fn draw_graphs(&self)

Trait Implementations§

Source§

impl<'tcx> Analysis for DataFlowAnalyzer<'tcx>

Source§

fn name(&self) -> &'static str

Return the name of the analysis.
Source§

fn run(&mut self)

Execute the analysis.
Source§

fn reset(&mut self)

Reset the analysis and cleanup the memory.
Source§

impl<'tcx> DataFlowAnalysis for DataFlowAnalyzer<'tcx>

Source§

fn get_fn_dataflow(&self, def_id: DefId) -> Option<DataFlowGraph>

The function returns the dataflow graph for the given function id.
Source§

fn get_all_dataflow(&self) -> DataFlowGraphMap

The function returns the dataflow graph for all functions.
Source§

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

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

fn get_fn_arg2ret(&self, def_id: DefId) -> Arg2Ret

The function returns an IndexVec of whether the returned Local depends on the parameter Local.
Source§

fn get_all_arg2ret(&self) -> Arg2RetMap

The function returns the dataflow between the arguments and return value for all functions

Auto Trait Implementations§

§

impl<'tcx> Freeze for DataFlowAnalyzer<'tcx>

§

impl<'tcx> !RefUnwindSafe for DataFlowAnalyzer<'tcx>

§

impl<'tcx> !Send for DataFlowAnalyzer<'tcx>

§

impl<'tcx> !Sync for DataFlowAnalyzer<'tcx>

§

impl<'tcx> Unpin for DataFlowAnalyzer<'tcx>

§

impl<'tcx> !UnwindSafe for DataFlowAnalyzer<'tcx>

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> 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, 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.