#[non_exhaustive]pub enum SlotKind {
Local {
size: u32,
align: u32,
},
Incoming {
offset: u32,
size: u32,
},
}Expand description
What a stack slot is.
§Examples
use backend_lang::mir::{Function, SlotKind};
use backend_lang::x86_64::SYSV;
let mut f = Function::new("f", &SYSV);
let local = f.stack_slot(SlotKind::Local { size: 24, align: 8 })?;
let arg = f.stack_slot(SlotKind::Incoming { offset: 0, size: 8 })?;
assert_eq!(f.slot(local), Some(SlotKind::Local { size: 24, align: 8 }));
assert!(matches!(f.slot(arg), Some(SlotKind::Incoming { .. })));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Local
Space in this function’s frame.
Incoming
An argument the caller passed on the stack, at offset bytes above
the canonical frame address (see
ArgLoc::Stack).
Implementations§
Trait Implementations§
impl Copy for SlotKind
impl Eq for SlotKind
impl StructuralPartialEq for SlotKind
Auto Trait Implementations§
impl Freeze for SlotKind
impl RefUnwindSafe for SlotKind
impl Send for SlotKind
impl Sync for SlotKind
impl Unpin for SlotKind
impl UnsafeUnpin for SlotKind
impl UnwindSafe for SlotKind
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