[][src]Struct cranelift_codegen::ir::constant::ConstantPool

pub struct ConstantPool { /* fields omitted */ }

Maintains the mapping between a constant handle (i.e. Constant) and its constant data (i.e. ConstantData).

Methods

impl ConstantPool[src]

pub fn new() -> Self[src]

Create a new constant pool instance.

pub fn clear(&mut self)[src]

Empty the constant pool of all data.

pub fn insert(&mut self, constant_value: ConstantData) -> Constant[src]

Insert constant data into the pool, returning a handle for later referencing; when constant data is inserted that is a duplicate of previous constant data, the existing handle will be returned.

pub fn get(&self, constant_handle: Constant) -> &ConstantData[src]

Retrieve the constant data given a handle.

pub fn set_offset(
    &mut self,
    constant_handle: Constant,
    constant_offset: ConstantOffset
)
[src]

Assign an offset to a given constant, where the offset is the number of bytes from the beginning of the function to the beginning of the constant data inside the pool.

pub fn get_offset(&self, constant_handle: Constant) -> ConstantOffset[src]

Retrieve the offset of a given constant, where the offset is the number of bytes from the beginning of the function to the beginning of the constant data inside the pool.

pub fn iter(&self) -> impl Iterator<Item = (&Constant, &ConstantData)>[src]

Iterate over the constants in insertion order.

pub fn entries_mut(&mut self) -> impl Iterator<Item = &mut ConstantPoolEntry>[src]

Iterate over mutable entries in the constant pool in insertion order.

pub fn len(&self) -> usize[src]

Return the number of constants in the pool.

pub fn byte_size(&self) -> usize[src]

Return the combined size of all of the constant values in the pool.

Trait Implementations

impl Clone for ConstantPool[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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> 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.