pub enum Loc {
Reg(PReg),
Slot(StackSlot),
}Expand description
A place a value lives: a physical register or a stack slot.
§Examples
use backend_lang::mir::StackSlot;
use backend_lang::moves::Loc;
use backend_lang::x86_64::RAX;
assert_eq!(Loc::from(RAX), Loc::Reg(RAX));
assert_eq!(Loc::from(StackSlot::new(1)), Loc::Slot(StackSlot::new(1)));Variants§
Implementations§
Trait Implementations§
impl Copy for Loc
impl Eq for Loc
Source§impl Ord for Loc
impl Ord for Loc
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Loc
impl PartialOrd for Loc
impl StructuralPartialEq for Loc
Auto Trait Implementations§
impl Freeze for Loc
impl RefUnwindSafe for Loc
impl Send for Loc
impl Sync for Loc
impl Unpin for Loc
impl UnsafeUnpin for Loc
impl UnwindSafe for Loc
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