Skip to main content

AliasGraph

Struct AliasGraph 

Source
pub struct AliasGraph<'tcx> {
    pub path_graph: PathGraph<'tcx>,
    pub visit_times: usize,
    pub values: Vec<Value>,
    pub pts_graph: PtsGraph,
    pub move_sources: FxHashMap<usize, usize>,
    pub ret_alias: MopFnAliasPairs,
    pub arg_size: usize,
    pub span: Span,
}

Fields§

§path_graph: PathGraph<'tcx>§visit_times: usize§values: Vec<Value>

Per-slot type info — kept for SafeDrop compatibility. Indexed by value index = PtsGraph slot index.

§pts_graph: PtsGraph

New unified PtsGraph for both MoP alias and SafeDrop.

§move_sources: FxHashMap<usize, usize>

Tracks Move operand destinations → source value indices. Used by SafeDrop to propagate drop info through move chains.

§ret_alias: MopFnAliasPairs§arg_size: usize§span: Span

Implementations§

Source§

impl<'tcx> AliasGraph<'tcx>

Source

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

Resolve a MIR place to its value index, creating field nodes lazily if needed.

Source

pub fn call_target_of(&self, bb_index: usize) -> Option<DefId>

Source

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

Source§

impl<'tcx> AliasGraph<'tcx>

Source

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

Source

pub fn from_path_graph( tcx: TyCtxt<'tcx>, def_id: DefId, path_graph: PathGraph<'tcx>, ) -> AliasGraph<'tcx>

Source

pub fn def_id(&self) -> DefId

Source

pub fn tcx(&self) -> TyCtxt<'tcx>

Source

pub fn arg_size(&self) -> usize

Source

pub fn span(&self) -> Span

Source

pub fn cfg_block(&self, index: usize) -> &CfgBlock

Source

pub fn terminator(&self, index: usize) -> Option<&Terminator<'tcx>>

Source

pub fn enumerate_paths(&self) -> PathTree

Source

pub fn visit_times(&self) -> usize

Source

pub fn increment_visit_times(&mut self) -> usize

Source

pub fn value_to_slot_idx(&self, value_idx: usize) -> Option<usize>

Source

pub fn get_alias_set(&self, e: usize) -> Option<Vec<usize>>

Source

pub fn value_may_drop(&self, value_idx: usize) -> bool

Source

pub fn value_is_ptr(&self, value_idx: usize) -> bool

Source§

impl<'tcx> AliasGraph<'tcx>

Source

pub fn process_function_paths( &mut self, fn_map: &mut MopFnAliasMap, recursion_set: &mut HashSet<DefId>, )

Source

pub fn process_function_paths_opt( &mut self, precomputed_paths: Option<PathTree>, fn_map: &mut MopFnAliasMap, recursion_set: &mut HashSet<DefId>, )

Source

fn dfs_mop( &mut self, node: &PathNode, path: &mut Vec<usize>, fn_map: &mut MopFnAliasMap, rec_set: &mut HashSet<DefId>, ) -> Result<(), ()>

Source§

impl<'tcx> AliasGraph<'tcx>

Source

pub fn init_pts_graph(&mut self)

Source

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

Unified basic-block MIR processing, shared by MoP alias and SafeDrop.

Source

fn process_assignment( &mut self, place: &Place<'tcx>, rvalue: &Rvalue<'tcx>, span: Span, obs: &mut dyn AliasObserver, )

Source

fn resolve_operand(&mut self, place: &Place<'tcx>) -> Option<(usize, usize)>

Resolve a MIR Place to (value_index, pts_slot_index) if it may drop.

Source

fn place_to_value_idx(&self, place: &Place<'tcx>) -> Option<usize>

Lookup value index for a place without dynamic creation.

Source

fn projection_field(&mut self, base: &Place<'tcx>, field_idx: FieldIdx) -> usize

Ensure value entry exists for a field projection.

Source

pub fn slot_to_value_idx(&self, slot: &Slot) -> Option<usize>

Reverse lookup: given a Slot, find the corresponding value index.

Source

pub fn alias_bbcall( &mut self, bb_index: usize, fn_map: &MopFnAliasMap, obs: &mut dyn AliasObserver, )

Unified call-site processing, shared by MoP alias and SafeDrop.

Source

fn parse_call_slots( &mut self, bb_index: usize, ) -> (Vec<(usize, usize)>, usize, usize, Option<DefId>, Span)

Parse call terminator, returning slot-based merge info.

Source

fn apply_fn_alias_results_pts( &mut self, target_id: DefId, merge_vec: &[(usize, usize)], fn_map: &MopFnAliasMap, obs: &mut dyn AliasObserver, )

Source

pub fn merge_results_pts(&mut self)

Trait Implementations§

Source§

impl<'tcx> Display for AliasGraph<'tcx>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'tcx> DynSend for AliasGraph<'tcx>

§

impl<'tcx> DynSync for AliasGraph<'tcx>

§

impl<'tcx> Freeze for AliasGraph<'tcx>

§

impl<'tcx> Unpin for AliasGraph<'tcx>

§

impl<'tcx> UnsafeUnpin for AliasGraph<'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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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