Struct cranelift_codegen::ir::stackslot::StackSlots
source · [−]pub struct StackSlots {
pub layout_info: Option<StackLayoutInfo>,
/* private fields */
}
Expand description
Stack frame manager.
Keep track of all the stack slots used by a function.
Fields
layout_info: Option<StackLayoutInfo>
Layout information computed from layout_stack
.
Implementations
sourceimpl StackSlots
impl StackSlots
Stack slot manager functions that behave mostly like an entity map.
sourcepub fn push(&mut self, data: StackSlotData) -> StackSlot
pub fn push(&mut self, data: StackSlotData) -> StackSlot
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.
sourcepub fn iter(&self) -> Iter<'_, StackSlot, StackSlotData>
pub fn iter(&self) -> Iter<'_, StackSlot, StackSlotData>
Get an iterator over all the stack slot keys.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, StackSlot, StackSlotData>
pub fn iter_mut(&mut self) -> IterMut<'_, StackSlot, StackSlotData>
Get an iterator over all the stack slot keys, mutable edition.
sourcepub fn values(&self) -> Iter<'_, StackSlotData>
pub fn values(&self) -> Iter<'_, StackSlotData>
Get an iterator over all the stack slot records.
sourcepub fn values_mut(&mut self) -> IterMut<'_, StackSlotData>
pub fn values_mut(&mut self) -> IterMut<'_, StackSlotData>
Get an iterator over all the stack slot records, mutable edition.
sourceimpl StackSlots
impl StackSlots
Higher-level stack frame manipulation functions.
sourcepub fn make_spill_slot(&mut self, ty: Type) -> StackSlot
pub fn make_spill_slot(&mut self, ty: Type) -> StackSlot
Create a new spill slot for spilling values of type ty
.
sourcepub fn make_incoming_arg(&mut self, size: u32, offset: StackOffset) -> StackSlot
pub fn make_incoming_arg(&mut self, size: u32, offset: StackOffset) -> StackSlot
Create a stack slot representing an incoming function argument.
sourcepub fn get_outgoing_arg(&mut self, size: u32, offset: StackOffset) -> StackSlot
pub fn get_outgoing_arg(&mut self, size: u32, offset: StackOffset) -> StackSlot
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.
sourcepub fn get_emergency_slot(
&mut self,
ty: Type,
in_use: &[PackedOption<StackSlot>]
) -> StackSlot
pub fn get_emergency_slot(
&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
sourceimpl Clone for StackSlots
impl Clone for StackSlots
sourcefn clone(&self) -> StackSlots
fn clone(&self) -> StackSlots
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StackSlots
impl Debug for StackSlots
sourceimpl Default for StackSlots
impl Default for StackSlots
sourcefn default() -> StackSlots
fn default() -> StackSlots
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for StackSlots
impl<'de> Deserialize<'de> for StackSlots
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Index<StackSlot> for StackSlots
impl Index<StackSlot> for StackSlots
type Output = StackSlotData
type Output = StackSlotData
The returned type after indexing.
sourcefn index(&self, ss: StackSlot) -> &StackSlotData
fn index(&self, ss: StackSlot) -> &StackSlotData
Performs the indexing (container[index]
) operation. Read more
sourceimpl IndexMut<StackSlot> for StackSlots
impl IndexMut<StackSlot> for StackSlots
sourcefn index_mut(&mut self, ss: StackSlot) -> &mut StackSlotData
fn index_mut(&mut self, ss: StackSlot) -> &mut StackSlotData
Performs the mutable indexing (container[index]
) operation. Read more
sourceimpl PartialEq<StackSlots> for StackSlots
impl PartialEq<StackSlots> for StackSlots
sourcefn eq(&self, other: &StackSlots) -> bool
fn eq(&self, other: &StackSlots) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StackSlots) -> bool
fn ne(&self, other: &StackSlots) -> bool
This method tests for !=
.
sourceimpl Serialize for StackSlots
impl Serialize for StackSlots
impl Eq for StackSlots
impl StructuralEq for StackSlots
impl StructuralPartialEq for StackSlots
Auto Trait Implementations
impl RefUnwindSafe for StackSlots
impl Send for StackSlots
impl Sync for StackSlots
impl Unpin for StackSlots
impl UnwindSafe for StackSlots
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more