pub struct Value {
pub index: usize,
pub local: usize,
pub need_drop: bool,
pub may_drop: bool,
pub kind: ValueKind,
pub father: Option<FatherInfo>,
pub fields: FxHashMap<usize, usize>,
}Expand description
Represents a value node in the alias analysis graph. Each value may correspond to local variables, or fields of structures temporarily crated in the alias analysis
Fields§
§index: usizeA unique value index, which is the same as local if the number within the range of local
variables; When encountering fields (e.g., 1.1), the index points to the unique field of the local.
local: usizeReal local variable identifier in mir.
need_drop: boolIndicates whether this value needs to be dropped at the end of its lifetime.
may_drop: boolIndicates whether this value may need to be dropped (uncertain drop semantics).
kind: ValueKindThe type of this value node (see ValueKind).
father: Option<FatherInfo>Information about this value’s parent, if it is a field of a parent node.
fields: FxHashMap<usize, usize>Mapping from field IDs to their value node IDs for field accesses. First field: field id; Second field: value id;
Implementations§
Source§impl Value
impl Value
Sourcepub fn new(index: usize, local: usize, need_drop: bool, may_drop: bool) -> Self
pub fn new(index: usize, local: usize, need_drop: bool, may_drop: bool) -> Self
Create a new value node with the provided properties.
The kind defaults to ValueKind::Adt and father defaults to None.
Sourcepub fn is_ptr(&self) -> bool
pub fn is_ptr(&self) -> bool
Returns whether this value is a pointer (raw pointer or reference).
Sourcepub fn is_ref_count(&self) -> bool
pub fn is_ref_count(&self) -> bool
Returns whether this value is of a corner case type as defined in ValueKind.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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