Struct cranelift_codegen::Reg
source · pub struct Reg(/* private fields */);
Expand description
A register named in an instruction. This register can be either a
virtual register or a fixed physical register. It does not have
any constraints applied to it: those can be added later in
MachInst::get_operands()
when the Reg
s are converted to
Operand
s.
Implementations§
source§impl Reg
impl Reg
sourcepub fn to_real_reg(self) -> Option<RealReg>
pub fn to_real_reg(self) -> Option<RealReg>
Get the physical register (RealReg
), if this register is
one.
sourcepub fn to_virtual_reg(self) -> Option<VirtualReg>
pub fn to_virtual_reg(self) -> Option<VirtualReg>
Get the virtual (non-physical) register, if this register is one.
sourcepub fn is_virtual(self) -> bool
pub fn is_virtual(self) -> bool
Is this a virtual reg?
Trait Implementations§
source§impl Ord for Reg
impl Ord for Reg
source§impl PartialOrd for Reg
impl PartialOrd for Reg
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Reg
impl Eq for Reg
impl StructuralPartialEq for Reg
Auto Trait Implementations§
impl Freeze for Reg
impl RefUnwindSafe for Reg
impl Send for Reg
impl Sync for Reg
impl Unpin for Reg
impl UnwindSafe for Reg
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.