pub struct Variable {
pub name: String,
pub size: ByteSize,
pub is_temp: bool,
}
Expand description
A variable represents a register with a known size and name.
Variables can be temporary (or virtual). In this case they do not represent actual physical registers and are only used to store intermediate results necessary for representing more complex assembly instructions. Temporary variables are only valid until the end of the current assembly instruction. However, one assembly instruction may span more than one basic block in the intermediate representation (but never more than one function).
Fields§
§name: String
The name of the variable. Equals the register name if the variable is a physical register.
size: ByteSize
The size (in bytes) of the variable.
is_temp: bool
Set to false
for physical registers and to true
for temporary (virtual) variables.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Variable
impl<'de> Deserialize<'de> for Variable
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<&RegisterProperties> for Variable
impl From<&RegisterProperties> for Variable
source§fn from(register_prop: &RegisterProperties) -> IrVariable
fn from(register_prop: &RegisterProperties) -> IrVariable
Create a variable representing the same register as the given register_prop
.
source§impl From<Variable> for Variable
impl From<Variable> for Variable
source§fn from(pcode_var: Variable) -> IrVariable
fn from(pcode_var: Variable) -> IrVariable
Translate a P-Code variable into a register variable of the internally used IR. Panic if the variable does not represent a register.
source§impl Ord for Variable
impl Ord for Variable
source§impl PartialEq for Variable
impl PartialEq for Variable
source§impl PartialOrd for Variable
impl PartialOrd for Variable
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Variable
impl StructuralEq for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.