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

Create a new constant pool instance.

Empty the constant pool of all data.

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.

Retrieve the constant data given a handle.

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.

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.

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.

Iterate over the constants in insertion order.

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

Return the number of constants in the pool.

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.