RangeAnalyzer

Struct RangeAnalyzer 

Source
pub struct RangeAnalyzer<'tcx, T: IntervalArithmetic + ConstConvert + Debug> {
Show 13 fields pub tcx: TyCtxt<'tcx>, pub debug: bool, pub ssa_def_id: Option<DefId>, pub essa_def_id: Option<DefId>, pub final_vars: RAResultMap<'tcx, T>, pub ssa_places_mapping: FxHashMap<DefId, HashMap<Place<'tcx>, HashSet<Place<'tcx>>>>, pub fn_constraintgraph_mapping: FxHashMap<DefId, ConstraintGraph<'tcx, T>>, pub callgraph: CallGraphInfo<'tcx>, pub body_map: FxHashMap<DefId, Body<'tcx>>, pub cg_map: FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, pub vars_map: FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, pub final_vars_vec: RAVecResultMap<'tcx, T>, pub path_constraints: PathConstraintMap<'tcx>,
}

Fields§

§tcx: TyCtxt<'tcx>§debug: bool§ssa_def_id: Option<DefId>§essa_def_id: Option<DefId>§final_vars: RAResultMap<'tcx, T>§ssa_places_mapping: FxHashMap<DefId, HashMap<Place<'tcx>, HashSet<Place<'tcx>>>>§fn_constraintgraph_mapping: FxHashMap<DefId, ConstraintGraph<'tcx, T>>§callgraph: CallGraphInfo<'tcx>§body_map: FxHashMap<DefId, Body<'tcx>>§cg_map: FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>§vars_map: FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>§final_vars_vec: RAVecResultMap<'tcx, T>§path_constraints: PathConstraintMap<'tcx>

Implementations§

Source§

impl<'tcx, T> RangeAnalyzer<'tcx, T>

Source

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

Source

fn build_constraintgraph( &mut self, body_mut_ref: &'tcx Body<'tcx>, def_id: DefId, )

Source

fn only_caller_range_analysis(&mut self)

Source

pub fn start_path_constraints_analysis_for_defid( &mut self, def_id: DefId, ) -> Option<PathConstraint<'tcx>>

Source

pub fn start_path_constraints_analysis(&mut self)

Trait Implementations§

Source§

impl<'tcx, T> Analysis for RangeAnalyzer<'tcx, T>

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, T> RangeAnalysis<'tcx, T> for RangeAnalyzer<'tcx, T>

Source§

fn get_fn_range(&self, def_id: DefId) -> Option<RAResult<'tcx, T>>

The fucntion returns the range information for all local variables (Places) in a given function specified by def_id.
Source§

fn get_fn_ranges_percall(&self, def_id: DefId) -> Option<Vec<RAResult<'tcx, T>>>

The function returns the range analysis results for each call instance of the specified function. This is useful in interprocedural or context-sensitive analyses, where a function might be analyzed multiple times under different calling contexts.
Source§

fn get_all_fn_ranges(&self) -> RAResultMap<'tcx, T>

The function returns the complete mapping of range information for all functions in the crate.
Source§

fn get_all_fn_ranges_percall(&self) -> RAVecResultMap<'tcx, T>

The function returns the range results for every call instance of every function in the crate.
Source§

fn get_fn_local_range( &self, def_id: DefId, place: Place<'tcx>, ) -> Option<Range<T>>

The function returns the inferred range for a specific variable (Place) in a specific function.
Source§

fn get_fn_path_constraints(&self, def_id: DefId) -> Option<PathConstraint<'tcx>>

The function returns a mapping from feasible control-flow paths to symbolic constraints. Each constraint is a triple of (Place, Place, BinOp) representing path-sensitive relational information useful for pruning infeasible paths.
Source§

fn get_all_path_constraints(&self) -> PathConstraintMap<'tcx>

The function returns path constraints for all functions in the crate.

Auto Trait Implementations§

§

impl<'tcx, T> Freeze for RangeAnalyzer<'tcx, T>

§

impl<'tcx, T> !RefUnwindSafe for RangeAnalyzer<'tcx, T>

§

impl<'tcx, T> !Send for RangeAnalyzer<'tcx, T>

§

impl<'tcx, T> !Sync for RangeAnalyzer<'tcx, T>

§

impl<'tcx, T> Unpin for RangeAnalyzer<'tcx, T>
where T: Unpin,

§

impl<'tcx, T> !UnwindSafe for RangeAnalyzer<'tcx, T>

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.