ConstraintGraph

Struct ConstraintGraph 

Source
pub struct ConstraintGraph<'tcx, T: IntervalArithmetic + ConstConvert + Debug> {
Show 24 fields pub self_def_id: DefId, pub vars: VarNodes<'tcx, T>, pub oprs: Vec<BasicOpKind<'tcx, T>>, pub defmap: DefMap<'tcx>, pub usemap: UseMap<'tcx>, pub symbmap: SymbMap<'tcx>, pub values_branchmap: HashMap<&'tcx Place<'tcx>, ValueBranchMap<'tcx, T>>, constant_vector: Vec<T>, pub inst_rand_place_set: Vec<Place<'tcx>>, pub essa: DefId, pub ssa: DefId, pub index: i32, pub dfs: HashMap<&'tcx Place<'tcx>, i32>, pub root: HashMap<&'tcx Place<'tcx>, &'tcx Place<'tcx>>, pub in_component: HashSet<&'tcx Place<'tcx>>, pub components: HashMap<&'tcx Place<'tcx>, HashSet<&'tcx Place<'tcx>>>, pub worklist: VecDeque<&'tcx Place<'tcx>>, pub numAloneSCCs: usize, pub numSCCs: usize, pub final_vars: VarNodes<'tcx, T>, pub arg_count: usize, pub rerurn_places: HashSet<&'tcx Place<'tcx>>, pub switchbbs: HashMap<BasicBlock, (Place<'tcx>, Place<'tcx>)>, pub const_func_place: HashMap<&'tcx Place<'tcx>, usize>,
}

Fields§

§self_def_id: DefId§vars: VarNodes<'tcx, T>§oprs: Vec<BasicOpKind<'tcx, T>>§defmap: DefMap<'tcx>§usemap: UseMap<'tcx>§symbmap: SymbMap<'tcx>§values_branchmap: HashMap<&'tcx Place<'tcx>, ValueBranchMap<'tcx, T>>§constant_vector: Vec<T>§inst_rand_place_set: Vec<Place<'tcx>>§essa: DefId§ssa: DefId§index: i32§dfs: HashMap<&'tcx Place<'tcx>, i32>§root: HashMap<&'tcx Place<'tcx>, &'tcx Place<'tcx>>§in_component: HashSet<&'tcx Place<'tcx>>§components: HashMap<&'tcx Place<'tcx>, HashSet<&'tcx Place<'tcx>>>§worklist: VecDeque<&'tcx Place<'tcx>>§numAloneSCCs: usize§numSCCs: usize§final_vars: VarNodes<'tcx, T>§arg_count: usize§rerurn_places: HashSet<&'tcx Place<'tcx>>§switchbbs: HashMap<BasicBlock, (Place<'tcx>, Place<'tcx>)>§const_func_place: HashMap<&'tcx Place<'tcx>, usize>

Implementations§

Source§

impl<'tcx, T> ConstraintGraph<'tcx, T>

Source

pub fn convert_const(c: &Const<'_>) -> Option<T>

Source

pub fn new(self_def_id: DefId, essa: DefId, ssa: DefId) -> Self

Source

pub fn new_without_ssa(self_def_id: DefId) -> Self

Source

pub fn build_final_vars( &mut self, places_map: &HashMap<Place<'tcx>, HashSet<Place<'tcx>>>, ) -> (VarNodes<'tcx, T>, Vec<Place<'tcx>>)

Source

pub fn filter_final_vars( vars: &VarNodes<'tcx, T>, places_map: &HashMap<Place<'tcx>, HashSet<Place<'tcx>>>, ) -> HashMap<Place<'tcx>, Range<T>>

Source

pub fn test_and_print_all_symbolic_expressions(&self)

Source

pub fn rap_print_final_vars(&self)

Source

pub fn rap_print_vars(&self)

Source

pub fn print_vars(&self)

Source

pub fn print_conponent_vars(&self)

Source

fn print_values_branchmap(&self)

Source

fn print_symbmap(&self)

Source

fn print_defmap(&self)

Source

fn print_compusemap( &self, component: &HashSet<&'tcx Place<'tcx>>, comp_use_map: &HashMap<&'tcx Place<'tcx>, HashSet<usize>>, )

Source

fn print_usemap(&self)

Source

pub fn get_vars(&self) -> &VarNodes<'tcx, T>

Source

pub fn add_varnode(&mut self, v: &'tcx Place<'tcx>) -> &mut VarNode<'tcx, T>

Source

pub fn build_graph(&mut self, body: &'tcx Body<'tcx>)

Source

pub fn build_value_maps(&mut self, body: &'tcx Body<'tcx>)

Source

pub fn build_value_branch_map( &mut self, body: &Body<'tcx>, discr: &'tcx Operand<'tcx>, targets: &'tcx SwitchTargets, block: BasicBlock, block_data: &'tcx BasicBlockData<'tcx>, )

Source

pub fn flipped_binop(op: BinOp) -> Option<BinOp>

Source

fn reverse_binop(op: BinOp) -> Option<BinOp>

Source

fn extract_condition( &mut self, place: &'tcx Place<'tcx>, switch_block: &'tcx BasicBlockData<'tcx>, ) -> Option<(&'tcx Operand<'tcx>, &'tcx Operand<'tcx>, BinOp)>

Source

fn apply_comparison<U: IntervalArithmetic>( &self, constant: U, cmp_op: BinOp, is_true_branch: bool, const_in_left: bool, ) -> Range<U>

Source

fn build_value_goto_map(&self, block_index: BasicBlock, target: BasicBlock)

Source

pub fn build_varnodes(&mut self)

Source

pub fn build_symbolic_intersect_map(&mut self)

Source

pub fn build_use_map( &mut self, component: &HashSet<&'tcx Place<'tcx>>, ) -> HashMap<&'tcx Place<'tcx>, HashSet<usize>>

Source

pub fn build_terminator( &mut self, block: BasicBlock, terminator: &'tcx Terminator<'tcx>, )

Source

pub fn build_operations( &mut self, inst: &'tcx Statement<'tcx>, block: BasicBlock, )

Source

fn add_call_op( &mut self, sink: &'tcx Place<'tcx>, args: &'tcx Box<[Spanned<Operand<'tcx>>]>, terminator: &'tcx Terminator<'tcx>, func: &'tcx Operand<'tcx>, block: BasicBlock, )

Adds a function call operation to the graph.

Source

fn add_ssa_op( &mut self, sink: &'tcx Place<'tcx>, inst: &'tcx Statement<'tcx>, operands: &'tcx IndexVec<FieldIdx, Operand<'tcx>>, )

Source

fn add_use_op( &mut self, sink: &'tcx Place<'tcx>, inst: &'tcx Statement<'tcx>, op: &'tcx Operand<'tcx>, )

Source

fn add_essa_op( &mut self, sink: &'tcx Place<'tcx>, inst: &'tcx Statement<'tcx>, operands: &'tcx IndexVec<FieldIdx, Operand<'tcx>>, block: BasicBlock, )

Source

fn add_unary_op( &mut self, sink: &'tcx Place<'tcx>, inst: &'tcx Statement<'tcx>, operand: &'tcx Operand<'tcx>, op: UnOp, )

Source

fn add_binary_op( &mut self, sink: &'tcx Place<'tcx>, inst: &'tcx Statement<'tcx>, op1: &'tcx Operand<'tcx>, op2: &'tcx Operand<'tcx>, bin_op: BinOp, )

Source

fn fix_intersects(&mut self, component: &HashSet<&'tcx Place<'tcx>>)

Source

pub fn widen( &mut self, op: usize, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, ) -> bool

Source

pub fn narrow( &mut self, op: usize, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, ) -> bool

Source

fn pre_update( &mut self, comp_use_map: &HashMap<&'tcx Place<'tcx>, HashSet<usize>>, entry_points: &HashSet<&'tcx Place<'tcx>>, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

fn pos_update( &mut self, comp_use_map: &HashMap<&'tcx Place<'tcx>, HashSet<usize>>, entry_points: &HashSet<&'tcx Place<'tcx>>, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

fn generate_active_vars( &mut self, component: &HashSet<&'tcx Place<'tcx>>, active_vars: &mut HashSet<&'tcx Place<'tcx>>, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

fn generate_entry_points( &mut self, component: &HashSet<&'tcx Place<'tcx>>, entry_points: &mut HashSet<&'tcx Place<'tcx>>, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

fn propagate_to_next_scc( &mut self, component: &HashSet<&'tcx Place<'tcx>>, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

pub fn solve_const_func_call( &mut self, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

pub fn store_vars(&mut self, varnodes_vec: &mut Vec<RefCell<VarNodes<'tcx, T>>>)

Source

pub fn reset_vars(&mut self, varnodes_vec: &mut Vec<RefCell<VarNodes<'tcx, T>>>)

Source

pub fn find_intervals( &mut self, cg_map: &FxHashMap<DefId, Rc<RefCell<ConstraintGraph<'tcx, T>>>>, vars_map: &mut FxHashMap<DefId, Vec<RefCell<VarNodes<'tcx, T>>>>, )

Source

pub fn merge_return_places(&mut self)

Source

pub fn add_control_dependence_edges(&mut self)

Source

pub fn del_control_dependence_edges(&mut self)

Source

pub fn build_nuutila(&mut self, single: bool)

Source

pub fn visit( &mut self, place: &'tcx Place<'tcx>, stack: &mut Vec<&'tcx Place<'tcx>>, )

Source

pub fn get_symbolicexpression( &self, place: &'tcx Place<'tcx>, ) -> Option<SymbolicExpr<'tcx>>

Source

fn get_symbolic_expression_recursive( &self, place: &'tcx Place<'tcx>, memo: &mut HashMap<&'tcx Place<'tcx>, Option<SymbolicExpr<'tcx>>>, in_progress: &mut HashSet<&'tcx Place<'tcx>>, ) -> Option<SymbolicExpr<'tcx>>

Source

fn op_kind_to_symbolic_expr( &self, op_kind: &BasicOpKind<'tcx, T>, memo: &mut HashMap<&'tcx Place<'tcx>, Option<SymbolicExpr<'tcx>>>, in_progress: &mut HashSet<&'tcx Place<'tcx>>, ) -> Option<SymbolicExpr<'tcx>>

Source

pub fn start_analyze_path_constraints( &mut self, body: &'tcx Body<'tcx>, all_paths_indices: &[Vec<usize>], ) -> HashMap<Vec<usize>, Vec<(Place<'tcx>, Place<'tcx>, BinOp)>>

Source

pub fn analyze_path_constraints( &self, body: &'tcx Body<'tcx>, all_paths_indices: &[Vec<usize>], ) -> HashMap<Vec<usize>, Vec<(Place<'tcx>, Place<'tcx>, BinOp)>>

Trait Implementations§

Source§

impl<'tcx, T: Clone + IntervalArithmetic + ConstConvert + Debug> Clone for ConstraintGraph<'tcx, T>

Source§

fn clone(&self) -> ConstraintGraph<'tcx, T>

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<'tcx, T: Debug + IntervalArithmetic + ConstConvert + Debug> Debug for ConstraintGraph<'tcx, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

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

§

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

§

impl<'tcx, T> Send for ConstraintGraph<'tcx, T>
where T: Send,

§

impl<'tcx, T> Sync for ConstraintGraph<'tcx, T>
where T: Sync,

§

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

§

impl<'tcx, T> !UnwindSafe for ConstraintGraph<'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> 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> 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.