Struct rupta::mir::path::Path

source ·
pub struct Path {
    pub value: PathEnum,
}
Expand description

The customized representation for a local variable, heap objects, …

Resembles the Place type in rustc.

Fields§

§value: PathEnum

Implementations§

source§

impl Path

source

pub fn new_local(func_id: FuncId, ordinal: usize) -> Rc<Path>

Creates a path to the local variable corresponding to the ordinal.

source

pub fn new_parameter(func_id: FuncId, ordinal: usize) -> Rc<Path>

Creates a path to the parameter corresponding to the ordinal.

source

pub fn new_return_value(func_id: FuncId) -> Rc<Path>

Creates a path to the return value.

source

pub fn new_local_parameter_or_result( func_id: FuncId, ordinal: usize, argument_count: usize ) -> Rc<Path>

Creates a path to the local variable, parameter or result local, corresponding to the ordinal.

source

pub fn new_aux(func_id: FuncId, ordinal: usize) -> Rc<Path>

Creates a new auxiliary path.

source

pub fn new_heap_obj(func_id: FuncId, location: Location) -> Rc<Path>

Creates a path to the heap object.

source

pub fn new_constant() -> Rc<Path>

Creates a path to a constant.

source

pub fn new_static_variable(def_id: DefId) -> Rc<Path>

Creates a path to a static variable.

source

pub fn new_promoted(def_id: DefId, ordinal: usize) -> Rc<Path>

Creates a path to a promoted constant.

source

pub fn new_argumentv1_arr() -> Rc<Path>

Creates a path to a argumentv1 array.

source

pub fn new_str_ref_arr() -> Rc<Path>

Creates a path to a &str array.

source

pub fn new_qualified(base: Rc<Path>, projection: ProjectionElems) -> Rc<Path>

Creates a path that qualifies the given root path with the given projection.

source

pub fn new_offset(base: Rc<Path>, offset: usize) -> Rc<Path>

Creates a path that qualifies the given root path with the given offset.

source

pub fn new_index(collection_path: Rc<Path>) -> Rc<Path>

Creates a path that selects the element at a given index value of the array at the given path.

source

pub fn new_field(base: Rc<Path>, field_index: usize) -> Rc<Path>

Creates a path that selects the given field of the struct at the given path.

source

pub fn new_union_field(base: Rc<Path>, field_index: usize) -> Rc<Path>

Creates a path that selects the given union field of the union at the given path.

source

pub fn new_downcast(base: Rc<Path>, downcast_variant: usize) -> Rc<Path>

Creates a path that selects the given downcast of the enum at the given path.

source

pub fn new_function(func_id: FuncId) -> Rc<Path>

Creates a path referring to function item.

source

pub fn new_type(index: usize) -> Rc<Path>

Creates a path referring to a type item.

source

pub fn new_deref(address_path: Rc<Path>) -> Rc<Path>

Creates a path to the target memory of a reference value.

source

pub fn dyn_ptr_metadata(dyn_ptr_path: &Rc<Path>) -> Rc<Path>

Creates a path representing the metadata of a dynamic pointer.

source

pub fn append_projection_elem( path: &Rc<Path>, projection_elem: PathSelector ) -> Rc<Path>

Creates a path by appending the projection elem.

source

pub fn append_projection( path: &Rc<Path>, projection_elems: &ProjectionElems ) -> Rc<Path>

Creates a path by appending the projection elems.

source

pub fn add_offset(path: &Rc<Path>, offset: usize) -> Rc<Path>

source

pub fn truncate_projection_elems(path: &Rc<Path>, len: usize) -> Rc<Path>

Creates a path by truncating the projection elems.

source

pub fn remove_cast(path: &Rc<Path>) -> Rc<Path>

Returns the original path by removing the cast.

source

pub fn is_constant(&self) -> bool

Trait Implementations§

source§

impl Clone for Path

source§

fn clone(&self) -> Path

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Path

source§

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

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

impl Hash for Path

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Path

source§

fn eq(&self, other: &Path) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Path

source§

impl StructuralPartialEq for Path

Auto Trait Implementations§

§

impl RefUnwindSafe for Path

§

impl !Send for Path

§

impl !Sync for Path

§

impl Unpin for Path

§

impl UnwindSafe for Path

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.