MopGraph

Struct MopGraph 

Source
pub struct MopGraph<'tcx> {
    pub def_id: DefId,
    pub tcx: TyCtxt<'tcx>,
    pub arg_size: usize,
    pub span: Span,
    pub values: Vec<Value>,
    pub blocks: Vec<Block<'tcx>>,
    pub constants: FxHashMap<usize, usize>,
    pub discriminants: FxHashMap<usize, usize>,
    pub visit_times: usize,
    pub alias_set: Vec<usize>,
    pub ret_alias: MopAAResult,
    pub terminators: Vec<TerminatorKind<'tcx>>,
}

Fields§

§def_id: DefId§tcx: TyCtxt<'tcx>§arg_size: usize§span: Span§values: Vec<Value>§blocks: Vec<Block<'tcx>>§constants: FxHashMap<usize, usize>§discriminants: FxHashMap<usize, usize>§visit_times: usize§alias_set: Vec<usize>§ret_alias: MopAAResult§terminators: Vec<TerminatorKind<'tcx>>

Implementations§

Source§

impl<'tcx> MopGraph<'tcx>

Source

pub fn alias_bb(&mut self, bb_index: usize)

Source

pub fn alias_bbcall( &mut self, bb_index: usize, fn_map: &mut MopAAResultMap, recursion_set: &mut HashSet<DefId>, )

Source

pub fn projection(&mut self, is_right: bool, place: Place<'tcx>) -> usize

Source

pub fn merge_alias(&mut self, lv: usize, rv: usize, depth: usize)

Source

pub fn merge(&mut self, ret_alias: &MopAAFact, arg_vec: &[usize])

Source

pub fn merge_results(&mut self, results_nodes: Vec<Value>)

Source

pub fn get_field_seq(&self, value: &Value) -> Vec<usize>

Source

pub fn union_find(&mut self, e: usize) -> usize

Source

pub fn union_merge(&mut self, e1: usize, e2: usize)

Source

pub fn union_is_same(&mut self, e1: usize, e2: usize) -> bool

Source

pub fn get_alias_set(&mut self, e: usize) -> HashSet<usize>

Source

pub fn union_has_alias(&mut self, e: usize) -> bool

Source§

impl<'tcx> MopGraph<'tcx>

Source

pub fn new(tcx: TyCtxt<'tcx>, def_id: DefId) -> MopGraph<'tcx>

Source

pub fn dfs_on_spanning_tree( &self, index: usize, stack: &mut Vec<usize>, paths: &mut Vec<Vec<usize>>, )

Source

pub fn get_paths(&self) -> Vec<Vec<usize>>

Source

pub fn get_all_branch_sub_blocks_paths(&self) -> Vec<Vec<usize>>

Source

pub fn get_branch_sub_blocks_for_path(&self, path: &[usize]) -> Vec<usize>

Source

pub fn get_switch_conds(&mut self, bb_idx: usize) -> Option<usize>

Source§

impl<'tcx> MopGraph<'tcx>

Source

pub fn split_check( &mut self, bb_idx: usize, fn_map: &mut MopAAResultMap, recursion_set: &mut HashSet<DefId>, )

Source

pub fn split_check_with_cond( &mut self, bb_idx: usize, path_discr_id: usize, path_discr_val: usize, fn_map: &mut MopAAResultMap, recursion_set: &mut HashSet<DefId>, )

Source

pub fn check( &mut self, bb_idx: usize, fn_map: &mut MopAAResultMap, recursion_set: &mut HashSet<DefId>, )

Source

pub fn calculate_scc_order( &mut self, start: usize, cur: usize, scc: &Vec<usize>, path: &mut Vec<usize>, stacked_discriminants: &mut HashMap<usize, usize>, visited: &mut HashSet<usize>, paths_in_scc: &mut Vec<Vec<usize>>, )

This function performs a DFS traversal across the SCC, extracting all possible orderings that respect the control-flow structure and SwitchInt branching, taking into account enum discriminants and constant branches.

Trait Implementations§

Source§

impl<'tcx> Display for MopGraph<'tcx>

Source§

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

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

impl<'tcx> Scc for MopGraph<'tcx>

Source§

fn on_scc_found(&mut self, root: usize, scc_components: &[usize])

Source§

fn get_next(&mut self, root: usize) -> FxHashSet<usize>

Source§

fn get_size(&mut self) -> usize

Source§

fn find_scc(&mut self)

Source§

fn tarjan( &mut self, index: usize, stack: &mut Vec<usize>, instack: &mut FxHashSet<usize>, dfn: &mut Vec<usize>, low: &mut Vec<usize>, time: &mut usize, )

Source§

impl<'tcx> SccHelper<'tcx> for MopGraph<'tcx>

Source§

fn blocks(&self) -> &Vec<Block<'tcx>>

Source§

fn blocks_mut(&mut self) -> &mut Vec<Block<'tcx>>

Source§

fn switch_conds(&mut self, node: usize) -> Option<usize>

Auto Trait Implementations§

§

impl<'tcx> Freeze for MopGraph<'tcx>

§

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

§

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

§

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

§

impl<'tcx> Unpin for MopGraph<'tcx>

§

impl<'tcx> !UnwindSafe for MopGraph<'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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V