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: PtsGraphNew 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: SpanImplementations§
Source§impl<'tcx> AliasGraph<'tcx>
impl<'tcx> AliasGraph<'tcx>
Sourcepub fn projection(&mut self, place: Place<'tcx>) -> usize
pub fn projection(&mut self, place: Place<'tcx>) -> usize
Resolve a MIR place to its value index, creating field nodes lazily if needed.
pub fn call_target_of(&self, bb_index: usize) -> Option<DefId>
pub fn get_field_seq(&self, value_idx: usize) -> Vec<usize>
Source§impl<'tcx> AliasGraph<'tcx>
impl<'tcx> AliasGraph<'tcx>
pub fn new(tcx: TyCtxt<'tcx>, def_id: DefId) -> AliasGraph<'tcx>
pub fn from_path_graph( tcx: TyCtxt<'tcx>, def_id: DefId, path_graph: PathGraph<'tcx>, ) -> AliasGraph<'tcx>
pub fn def_id(&self) -> DefId
pub fn tcx(&self) -> TyCtxt<'tcx>
pub fn arg_size(&self) -> usize
pub fn span(&self) -> Span
pub fn cfg_block(&self, index: usize) -> &CfgBlock
pub fn terminator(&self, index: usize) -> Option<&Terminator<'tcx>>
pub fn enumerate_paths(&self) -> PathTree
pub fn visit_times(&self) -> usize
pub fn increment_visit_times(&mut self) -> usize
pub fn value_to_slot_idx(&self, value_idx: usize) -> Option<usize>
pub fn get_alias_set(&self, e: usize) -> Option<Vec<usize>>
pub fn value_may_drop(&self, value_idx: usize) -> bool
pub fn value_is_ptr(&self, value_idx: usize) -> bool
Source§impl<'tcx> AliasGraph<'tcx>
impl<'tcx> AliasGraph<'tcx>
pub fn process_function_paths( &mut self, fn_map: &mut MopFnAliasMap, recursion_set: &mut HashSet<DefId>, )
pub fn process_function_paths_opt( &mut self, precomputed_paths: Option<PathTree>, fn_map: &mut MopFnAliasMap, recursion_set: &mut HashSet<DefId>, )
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>
impl<'tcx> AliasGraph<'tcx>
pub fn init_pts_graph(&mut self)
Sourcepub fn alias_bb(&mut self, bb_index: usize, obs: &mut dyn AliasObserver)
pub fn alias_bb(&mut self, bb_index: usize, obs: &mut dyn AliasObserver)
Unified basic-block MIR processing, shared by MoP alias and SafeDrop.
fn process_assignment( &mut self, place: &Place<'tcx>, rvalue: &Rvalue<'tcx>, span: Span, obs: &mut dyn AliasObserver, )
Sourcefn resolve_operand(&mut self, place: &Place<'tcx>) -> Option<(usize, usize)>
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.
Sourcefn place_to_value_idx(&self, place: &Place<'tcx>) -> Option<usize>
fn place_to_value_idx(&self, place: &Place<'tcx>) -> Option<usize>
Lookup value index for a place without dynamic creation.
Sourcefn projection_field(&mut self, base: &Place<'tcx>, field_idx: FieldIdx) -> usize
fn projection_field(&mut self, base: &Place<'tcx>, field_idx: FieldIdx) -> usize
Ensure value entry exists for a field projection.
Sourcepub fn slot_to_value_idx(&self, slot: &Slot) -> Option<usize>
pub fn slot_to_value_idx(&self, slot: &Slot) -> Option<usize>
Reverse lookup: given a Slot, find the corresponding value index.
Sourcepub fn alias_bbcall(
&mut self,
bb_index: usize,
fn_map: &MopFnAliasMap,
obs: &mut dyn AliasObserver,
)
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.
Sourcefn parse_call_slots(
&mut self,
bb_index: usize,
) -> (Vec<(usize, usize)>, usize, usize, Option<DefId>, Span)
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.
fn apply_fn_alias_results_pts( &mut self, target_id: DefId, merge_vec: &[(usize, usize)], fn_map: &MopFnAliasMap, obs: &mut dyn AliasObserver, )
pub fn merge_results_pts(&mut self)
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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