pub struct VariableName { /* private fields */ }Expand description
A IR variable name consists of three components.
- The original name (obtained from the source code).
- An optional suffix (used to ensure uniqueness when lifting to IR).
- An optional version (applied when the CFG is converted to SSA form).
Implementations§
source§impl VariableName
impl VariableName
sourcepub fn from_string<N: ToString>(name: N) -> VariableName
pub fn from_string<N: ToString>(name: N) -> VariableName
Returns a new variable name with the given name (without suffix or version).
pub fn name(&self) -> &String
pub fn suffix(&self) -> &Option<String>
pub fn version(&self) -> &Option<usize>
sourcepub fn with_suffix<S: ToString>(&self, suffix: S) -> VariableName
pub fn with_suffix<S: ToString>(&self, suffix: S) -> VariableName
Returns a new copy of the variable name, adding the given suffix.
sourcepub fn with_version(&self, version: usize) -> VariableName
pub fn with_version(&self, version: usize) -> VariableName
Returns a new copy of the variable name, adding the given version.
sourcepub fn without_suffix(&self) -> VariableName
pub fn without_suffix(&self) -> VariableName
Returns a new copy of the variable name with the suffix dropped.
sourcepub fn without_version(&self) -> VariableName
pub fn without_version(&self) -> VariableName
Returns a new copy of the variable name with the version dropped.
Trait Implementations§
source§impl Clone for VariableName
impl Clone for VariableName
source§fn clone(&self) -> VariableName
fn clone(&self) -> VariableName
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for VariableName
impl Debug for VariableName
Debug for VariableName outputs the full name (including suffix and version).
source§impl Display for VariableName
impl Display for VariableName
Display for VariableName only outputs the original name.
source§impl Hash for VariableName
impl Hash for VariableName
source§impl PartialEq<VariableName> for VariableName
impl PartialEq<VariableName> for VariableName
source§fn eq(&self, other: &VariableName) -> bool
fn eq(&self, other: &VariableName) -> bool
This method tests for
self and other values to be equal, and is used
by ==.