pub enum Instruction {
Show 13 variants AsmBlock(AsmBlockVec<AsmArg>), Branch(Block), Call(FunctionVec<Value>), ConditionalBranch { cond_value: Value, true_block: Block, false_block: Block, }, ExtractElement { array: Value, ty: Aggregate, index_val: Value, }, ExtractValue { aggregate: Value, ty: Aggregate, indices: Vec<u64>, }, GetPointer(Pointer), InsertElement { array: Value, ty: Aggregate, value: Value, index_val: Value, }, InsertValue { aggregate: Value, ty: Aggregate, value: Value, indices: Vec<u64>, }, Load(Pointer), Phi(Vec<(Block, Value)>), Ret(ValueType), Store { ptr: Pointer, stored_val: Value, },
}

Variants

AsmBlock(AsmBlockVec<AsmArg>)

An opaque list of ASM instructions passed directly to codegen.

Branch(Block)

An unconditional jump.

Call(FunctionVec<Value>)

A function call with a list of arguments.

ConditionalBranch

Fields

cond_value: Value
true_block: Block
false_block: Block

A conditional jump with the boolean condition value and true or false destinations.

ExtractElement

Fields

array: Value
index_val: Value

Reading a specific element from an array.

ExtractValue

Fields

aggregate: Value
indices: Vec<u64>

Reading a specific field from (nested) structs.

GetPointer(Pointer)

Return a pointer as a value.

InsertElement

Fields

array: Value
value: Value
index_val: Value

Writing a specific value to an array.

InsertValue

Fields

aggregate: Value
value: Value
indices: Vec<u64>

Writing a specific value to a (nested) struct field.

Load(Pointer)

Read a value from a memory pointer.

Phi(Vec<(Block, Value)>)

Choose a value from a list depending on the preceding block.

Ret(ValueType)

Return from a function.

Store

Fields

ptr: Pointer
stored_val: Value

Write a value to a memory pointer.

Implementations

Some Instructions can return a value, but for some a return value doesn’t make sense.

Those which perform side effects such as writing to memory and also terminators such as Ret do not have a type.

Some Instructions may have struct arguments. Return it if so for this instruction.

Replace old_val with new_val if it is referenced by this instruction’s arguments.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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.

Should always be Self

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)

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.