Struct cretonne_codegen::ir::stackslot::StackSlots
[−]
[src]
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 set_offset(&mut self, ss: StackSlot, offset: StackOffset)
[src]
Set the offset of a stack slot.
ⓘImportant traits for Iter<'a, K, V>pub fn iter(&self) -> Iter<StackSlot, StackSlotData>
[src]
Get an iterator over all the stack slot keys.
ⓘImportant traits for IterMut<'a, K, V>pub fn iter_mut(&mut self) -> IterMut<StackSlot, StackSlotData>
[src]
Get an iterator over all the stack slot keys, mutable edition.
ⓘImportant traits for Iter<'a, T>pub fn values(&self) -> Iter<StackSlotData>
[src]
Get an iterator over all the stack slot records.
ⓘImportant traits for IterMut<'a, T>pub fn values_mut(&mut self) -> IterMut<StackSlotData>
[src]
Get an iterator over all the stack slot records, mutable edition.
ⓘImportant traits for Keys<K>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]
&mut self,
ty: Type,
in_use: &[PackedOption<StackSlot>]
) -> StackSlot
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 Clone for StackSlots
[src]
fn clone(&self) -> StackSlots
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for StackSlots
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Index<StackSlot> for StackSlots
[src]
type Output = StackSlotData
The returned type after indexing.
fn index(&self, ss: StackSlot) -> &StackSlotData
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<StackSlot> for StackSlots
[src]
fn index_mut(&mut self, ss: StackSlot) -> &mut StackSlotData
[src]
Performs the mutable indexing (container[index]
) operation.