flowistry_pdg_construction::calling_convention

Struct PlaceTranslator

Source
pub struct PlaceTranslator<'a, 'tcx> {
    async_info: &'a AsyncInfo,
    parent_body_def_id: DefId,
    parent_body: &'a Body<'tcx>,
    tcx: TyCtxt<'tcx>,
    destination: Place<'tcx>,
    calling_convention: &'a CallingConvention<'tcx>,
    precise: bool,
}
Expand description

This struct represents all the information necessary to translate places from a child (the callee) to its parent (caller) at the boundary of a particular function call.

Fields§

§async_info: &'a AsyncInfo§parent_body_def_id: DefId§parent_body: &'a Body<'tcx>§tcx: TyCtxt<'tcx>§destination: Place<'tcx>§calling_convention: &'a CallingConvention<'tcx>§precise: bool

Governs whether the translation produces precise results (1-1 child-parent translations) or approximate one’s (discarding child projections).

Implementations§

Source§

impl<'a, 'tcx> PlaceTranslator<'a, 'tcx>

Source

pub(crate) fn new( async_info: &'a AsyncInfo, parent_body_def_id: DefId, parent_body: &'a Body<'tcx>, tcx: TyCtxt<'tcx>, destination: Place<'tcx>, calling_convention: &'a CallingConvention<'tcx>, precise: bool, ) -> Self

destination must be the place to which the return is assigned in the parent (caller).

The precise parameter governs whether the translation produces precise results (1-1 child-parent translations) or approximate one’s (discarding child projections).

Source

pub(crate) fn translate_to_parent( &self, child: Place<'tcx>, ) -> Option<Place<'tcx>>

Returns a fully translated parent place. If self.precise == true this place will be a precise 1-1 translation, otherwise just the base parent place.

Returns None if the input child cannot be represented in the parent.

Source

pub(crate) fn handle_translate<'b>( &'b self, child: Place<'tcx>, ) -> Option<PlaceTranslation<'b, 'tcx>>

Returns a calculated translation that needs to be finished.

Returns None if the input child cannot be represented in the parent.

Auto Trait Implementations§

§

impl<'a, 'tcx> Freeze for PlaceTranslator<'a, 'tcx>

§

impl<'a, 'tcx> !RefUnwindSafe for PlaceTranslator<'a, 'tcx>

§

impl<'a, 'tcx> !Send for PlaceTranslator<'a, 'tcx>

§

impl<'a, 'tcx> !Sync for PlaceTranslator<'a, 'tcx>

§

impl<'a, 'tcx> Unpin for PlaceTranslator<'a, 'tcx>

§

impl<'a, 'tcx> !UnwindSafe for PlaceTranslator<'a, '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> 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
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.
Source§

impl<T> Captures<'_> for T
where T: ?Sized,