[][src]Struct cranelift_codegen::ir::stackslot::StackSlots

pub struct StackSlots {
    pub frame_size: Option<StackSize>,
    // some fields omitted
}

Stack frame manager.

Keep track of all the stack slots used by a function.

Fields

frame_size: Option<StackSize>

The total size of the stack frame.

This is the distance from the stack pointer in the current function to the stack pointer in the calling function, so it includes a pushed return address as well as space for outgoing call arguments.

This is computed by the layout() method.

Methods

impl StackSlots[src]

Stack slot manager functions that behave mostly like an entity map.

pub fn new() -> Self[src]

Create an empty stack slot manager.

pub fn clear(&mut self)[src]

Clear out everything.

pub fn push(&mut self, data: StackSlotData) -> StackSlot[src]

Allocate a new stack slot.

This function should be primarily used by the text format parser. There are more convenient functions for creating specific kinds of stack slots below.

pub fn is_valid(&self, ss: StackSlot) -> bool[src]

Check if ss is a valid stack slot reference.

pub fn iter(&self) -> Iter<StackSlot, StackSlotData>[src]

Get an iterator over all the stack slot keys.

pub fn iter_mut(&mut self) -> IterMut<StackSlot, StackSlotData>[src]

Get an iterator over all the stack slot keys, mutable edition.

pub fn values(&self) -> Iter<StackSlotData>[src]

Get an iterator over all the stack slot records.

pub fn values_mut(&mut self) -> IterMut<StackSlotData>[src]

Get an iterator over all the stack slot records, mutable edition.

pub fn keys(&self) -> Keys<StackSlot>[src]

Get an iterator over all the stack slot keys.

pub fn next_key(&self) -> StackSlot[src]

Get a reference to the next stack slot that would be created by push().

This should just be used by the parser.

impl StackSlots[src]

Higher-level stack frame manipulation functions.

pub fn make_spill_slot(&mut self, ty: Type) -> StackSlot[src]

Create a new spill slot for spilling values of type ty.

pub fn make_incoming_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot[src]

Create a stack slot representing an incoming function argument.

pub fn get_outgoing_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot[src]

Get a stack slot representing an outgoing argument.

This may create a new stack slot, or reuse an existing outgoing stack slot with the requested offset and size.

The requested offset is relative to this function's stack pointer immediately before making the call.

pub fn get_emergency_slot(
    &mut self,
    ty: Type,
    in_use: &[PackedOption<StackSlot>]
) -> StackSlot
[src]

Get an emergency spill slot that can be used to store a ty value.

This may allocate a new slot, or it may reuse an existing emergency spill slot, excluding any slots in the in_use list.

Trait Implementations

impl Debug for StackSlots[src]

impl PartialEq<StackSlots> for StackSlots[src]

impl Eq for StackSlots[src]

impl Index<StackSlot> for StackSlots[src]

type Output = StackSlotData

The returned type after indexing.

impl IndexMut<StackSlot> for StackSlots[src]

impl StructuralPartialEq for StackSlots[src]

impl StructuralEq for StackSlots[src]

impl Clone for StackSlots[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.