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.