Struct cranelift_codegen::ir::constant::ConstantPool [−][src]
pub struct ConstantPool { /* fields omitted */ }
Expand description
Maintains the mapping between a constant handle (i.e. Constant
) and
its constant data (i.e. ConstantData
).
Implementations
impl ConstantPool
[src]
impl ConstantPool
[src]pub fn insert(&mut self, constant_value: ConstantData) -> Constant
[src]
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]
pub fn get(&self, constant_handle: Constant) -> &ConstantData
[src]Retrieve the constant data given a handle.
pub fn set(&mut self, constant_handle: Constant, constant_value: ConstantData)
[src]
pub fn set(&mut self, constant_handle: Constant, constant_value: ConstantData)
[src]Link a constant handle to its value. This does not de-duplicate data but does avoid
replacing any existing constant values. use set
to tie a specific const42
to its value;
use insert
to add a value and return the next available const
entity.
pub fn set_offset(
&mut self,
constant_handle: Constant,
constant_offset: ConstantOffset
)
[src]
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]
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]
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]
pub fn entries_mut(&mut self) -> impl Iterator<Item = &mut ConstantPoolEntry>
[src]Iterate over mutable entries in the constant pool in insertion order.
Trait Implementations
impl Clone for ConstantPool
[src]
impl Clone for ConstantPool
[src]fn clone(&self) -> ConstantPool
[src]
fn clone(&self) -> ConstantPool
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ConstantPool
impl Send for ConstantPool
impl Sync for ConstantPool
impl Unpin for ConstantPool
impl UnwindSafe for ConstantPool
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more