Skip to main content

MfpAliasAnalyzer

Struct MfpAliasAnalyzer 

Source
pub struct MfpAliasAnalyzer<'tcx> {
    tcx: TyCtxt<'tcx>,
    fn_map: FxHashMap<DefId, FnAliasPairs>,
}
Expand description

MFP-based alias analyzer

Fields§

§tcx: TyCtxt<'tcx>§fn_map: FxHashMap<DefId, FnAliasPairs>

Function summaries (alias relationships between arguments and return values)

Implementations§

Source§

impl<'tcx> MfpAliasAnalyzer<'tcx>

Source

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

Create a new MFP alias analyzer

Source

fn get_arg_count(&self, def_id: DefId) -> Option<usize>

Get argument count for a function (returns None if MIR not available)

Source

fn analyze_function( &mut self, def_id: DefId, fn_summaries: &Rc<RefCell<FxHashMap<DefId, FnAliasPairs>>>, )

Analyze a single function

Source

fn collect_reachable_functions( &self, def_id: DefId, reachable: &mut FxHashSet<DefId>, )

Recursively collect all reachable functions with available MIR

Trait Implementations§

Source§

impl<'tcx> AliasAnalysis for MfpAliasAnalyzer<'tcx>

Source§

fn get_fn_alias(&self, def_id: DefId) -> Option<FnAliasPairs>

Return the aliases among the function arguments and return value of a specific function.
Source§

fn get_all_fn_alias(&self) -> FnAliasMap

Return the aliases among the function arguments and return value for all functions.
Source§

fn get_local_fn_alias(&self) -> FnAliasMap

Return the aliases among the function arguments and return value for functions of the local crate.
Source§

fn get_local_origins(&self, _def_id: DefId) -> LocalOriginMap

Return the intra-procedural local → origin mapping for a function. Default returns empty; analyser implementations may override with cached or MoP-based results.
Source§

fn get_self_field_origin( &self, _def_id: DefId, _local: usize, _fields: &[usize], ) -> Option<FieldOrigin>

If a place (local + field projections) in a method body resolves to a struct’s self.field, return the field identity.
Source§

impl<'tcx> Analysis for MfpAliasAnalyzer<'tcx>

Source§

fn run(&mut self)

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'tcx> DynSend for MfpAliasAnalyzer<'tcx>

§

impl<'tcx> DynSync for MfpAliasAnalyzer<'tcx>

§

impl<'tcx> Freeze for MfpAliasAnalyzer<'tcx>

§

impl<'tcx> Unpin for MfpAliasAnalyzer<'tcx>

§

impl<'tcx> UnsafeUnpin for MfpAliasAnalyzer<'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, 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