pub enum InstructionData {
Show 46 variants AtomicCas { opcode: Opcode, args: [Value; 3], flags: MemFlags, }, AtomicRmw { opcode: Opcode, args: [Value; 2], flags: MemFlags, op: AtomicRmwOp, }, Binary { opcode: Opcode, args: [Value; 2], }, BinaryImm64 { opcode: Opcode, arg: Value, imm: Imm64, }, BinaryImm8 { opcode: Opcode, arg: Value, imm: Uimm8, }, Branch { opcode: Opcode, args: ValueList, destination: Block, }, BranchFloat { opcode: Opcode, args: ValueList, cond: FloatCC, destination: Block, }, BranchIcmp { opcode: Opcode, args: ValueList, cond: IntCC, destination: Block, }, BranchInt { opcode: Opcode, args: ValueList, cond: IntCC, destination: Block, }, BranchTable { opcode: Opcode, arg: Value, destination: Block, table: JumpTable, }, Call { opcode: Opcode, args: ValueList, func_ref: FuncRef, }, CallIndirect { opcode: Opcode, args: ValueList, sig_ref: SigRef, }, CondTrap { opcode: Opcode, arg: Value, code: TrapCode, }, DynamicStackLoad { opcode: Opcode, dynamic_stack_slot: DynamicStackSlot, }, DynamicStackStore { opcode: Opcode, arg: Value, dynamic_stack_slot: DynamicStackSlot, }, FloatCompare { opcode: Opcode, args: [Value; 2], cond: FloatCC, }, FloatCond { opcode: Opcode, arg: Value, cond: FloatCC, }, FloatCondTrap { opcode: Opcode, arg: Value, cond: FloatCC, code: TrapCode, }, FuncAddr { opcode: Opcode, func_ref: FuncRef, }, HeapAddr { opcode: Opcode, arg: Value, heap: Heap, imm: Uimm32, }, IntCompare { opcode: Opcode, args: [Value; 2], cond: IntCC, }, IntCompareImm { opcode: Opcode, arg: Value, cond: IntCC, imm: Imm64, }, IntCond { opcode: Opcode, arg: Value, cond: IntCC, }, IntCondTrap { opcode: Opcode, arg: Value, cond: IntCC, code: TrapCode, }, IntSelect { opcode: Opcode, args: [Value; 3], cond: IntCC, }, Jump { opcode: Opcode, args: ValueList, destination: Block, }, Load { opcode: Opcode, arg: Value, flags: MemFlags, offset: Offset32, }, LoadNoOffset { opcode: Opcode, arg: Value, flags: MemFlags, }, MultiAry { opcode: Opcode, args: ValueList, }, NullAry { opcode: Opcode, }, Shuffle { opcode: Opcode, args: [Value; 2], imm: Immediate, }, StackLoad { opcode: Opcode, stack_slot: StackSlot, offset: Offset32, }, StackStore { opcode: Opcode, arg: Value, stack_slot: StackSlot, offset: Offset32, }, Store { opcode: Opcode, args: [Value; 2], flags: MemFlags, offset: Offset32, }, StoreNoOffset { opcode: Opcode, args: [Value; 2], flags: MemFlags, }, TableAddr { opcode: Opcode, arg: Value, table: Table, offset: Offset32, }, Ternary { opcode: Opcode, args: [Value; 3], }, TernaryImm8 { opcode: Opcode, args: [Value; 2], imm: Uimm8, }, Trap { opcode: Opcode, code: TrapCode, }, Unary { opcode: Opcode, arg: Value, }, UnaryBool { opcode: Opcode, imm: bool, }, UnaryConst { opcode: Opcode, constant_handle: Constant, }, UnaryGlobalValue { opcode: Opcode, global_value: GlobalValue, }, UnaryIeee32 { opcode: Opcode, imm: Ieee32, }, UnaryIeee64 { opcode: Opcode, imm: Ieee64, }, UnaryImm { opcode: Opcode, imm: Imm64, },
}

Variants§

§

AtomicCas

Fields

§opcode: Opcode
§args: [Value; 3]
§flags: MemFlags
§

AtomicRmw

Fields

§opcode: Opcode
§args: [Value; 2]
§flags: MemFlags
§

Binary

Fields

§opcode: Opcode
§args: [Value; 2]
§

BinaryImm64

Fields

§opcode: Opcode
§arg: Value
§imm: Imm64
§

BinaryImm8

Fields

§opcode: Opcode
§arg: Value
§imm: Uimm8
§

Branch

Fields

§opcode: Opcode
§destination: Block
§

BranchFloat

Fields

§opcode: Opcode
§cond: FloatCC
§destination: Block
§

BranchIcmp

Fields

§opcode: Opcode
§cond: IntCC
§destination: Block
§

BranchInt

Fields

§opcode: Opcode
§cond: IntCC
§destination: Block
§

BranchTable

Fields

§opcode: Opcode
§arg: Value
§destination: Block
§

Call

Fields

§opcode: Opcode
§func_ref: FuncRef
§

CallIndirect

Fields

§opcode: Opcode
§sig_ref: SigRef
§

CondTrap

Fields

§opcode: Opcode
§arg: Value
§

DynamicStackLoad

Fields

§opcode: Opcode
§dynamic_stack_slot: DynamicStackSlot
§

DynamicStackStore

Fields

§opcode: Opcode
§arg: Value
§dynamic_stack_slot: DynamicStackSlot
§

FloatCompare

Fields

§opcode: Opcode
§args: [Value; 2]
§cond: FloatCC
§

FloatCond

Fields

§opcode: Opcode
§arg: Value
§cond: FloatCC
§

FloatCondTrap

Fields

§opcode: Opcode
§arg: Value
§cond: FloatCC
§

FuncAddr

Fields

§opcode: Opcode
§func_ref: FuncRef
§

HeapAddr

Fields

§opcode: Opcode
§arg: Value
§heap: Heap
§

IntCompare

Fields

§opcode: Opcode
§args: [Value; 2]
§cond: IntCC
§

IntCompareImm

Fields

§opcode: Opcode
§arg: Value
§cond: IntCC
§imm: Imm64
§

IntCond

Fields

§opcode: Opcode
§arg: Value
§cond: IntCC
§

IntCondTrap

Fields

§opcode: Opcode
§arg: Value
§cond: IntCC
§

IntSelect

Fields

§opcode: Opcode
§args: [Value; 3]
§cond: IntCC
§

Jump

Fields

§opcode: Opcode
§destination: Block
§

Load

Fields

§opcode: Opcode
§arg: Value
§flags: MemFlags
§offset: Offset32
§

LoadNoOffset

Fields

§opcode: Opcode
§arg: Value
§flags: MemFlags
§

MultiAry

Fields

§opcode: Opcode
§

NullAry

Fields

§opcode: Opcode
§

Shuffle

Fields

§opcode: Opcode
§args: [Value; 2]
§

StackLoad

Fields

§opcode: Opcode
§stack_slot: StackSlot
§offset: Offset32
§

StackStore

Fields

§opcode: Opcode
§arg: Value
§stack_slot: StackSlot
§offset: Offset32
§

Store

Fields

§opcode: Opcode
§args: [Value; 2]
§flags: MemFlags
§offset: Offset32
§

StoreNoOffset

Fields

§opcode: Opcode
§args: [Value; 2]
§flags: MemFlags
§

TableAddr

Fields

§opcode: Opcode
§arg: Value
§table: Table
§offset: Offset32
§

Ternary

Fields

§opcode: Opcode
§args: [Value; 3]
§

TernaryImm8

Fields

§opcode: Opcode
§args: [Value; 2]
§imm: Uimm8
§

Trap

Fields

§opcode: Opcode
§

Unary

Fields

§opcode: Opcode
§arg: Value
§

UnaryBool

Fields

§opcode: Opcode
§imm: bool
§

UnaryConst

Fields

§opcode: Opcode
§constant_handle: Constant
§

UnaryGlobalValue

Fields

§opcode: Opcode
§global_value: GlobalValue
§

UnaryIeee32

Fields

§opcode: Opcode
§

UnaryIeee64

Fields

§opcode: Opcode
§

UnaryImm

Fields

§opcode: Opcode
§imm: Imm64

Implementations§

source§

impl InstructionData

source

pub fn opcode(&self) -> Opcode

Get the opcode of this instruction.

source

pub fn typevar_operand(&self, pool: &ValueListPool) -> Option<Value>

Get the controlling type variable operand.

source

pub fn arguments<'a>(&'a self, pool: &'a ValueListPool) -> &[Value]

Get the value arguments to this instruction.

source

pub fn arguments_mut<'a>( &'a mut self, pool: &'a mut ValueListPool ) -> &mut [Value]

Get mutable references to the value arguments to this instruction.

source

pub fn take_value_list(&mut self) -> Option<ValueList>

Take out the value list with all the value arguments and return it.

This leaves the value list in the instruction empty. Use put_value_list to put the value list back.

source

pub fn put_value_list(&mut self, vlist: ValueList)

Put back a value list.

After removing a value list with take_value_list(), use this method to put it back. It is required that this instruction has a format that accepts a value list, and that the existing value list is empty. This avoids leaking list pool memory.

source

pub fn eq(&self, other: &Self, pool: &ValueListPool) -> bool

Compare two InstructionData for equality.

This operation requires a reference to a ValueListPool to determine if the contents of any ValueLists are equal.

source

pub fn hash<H: Hasher>(&self, state: &mut H, pool: &ValueListPool)

Hash an InstructionData.

This operation requires a reference to a ValueListPool to hash the contents of any ValueLists.

source§

impl InstructionData

Analyzing an instruction.

Avoid large matches on instruction formats by using the methods defined here to examine instructions.

source

pub fn analyze_branch<'a>(&'a self, pool: &'a ValueListPool) -> BranchInfo<'a>

Return information about the destination of a branch or jump instruction.

Any instruction that can transfer control to another block reveals its possible destinations here.

source

pub fn branch_destination(&self) -> Option<Block>

Get the single destination of this branch instruction, if it is a single destination branch or jump.

Multi-destination branches like br_table return None.

source

pub fn branch_destination_mut(&mut self) -> Option<&mut Block>

Get a mutable reference to the single destination of this branch instruction, if it is a single destination branch or jump.

Multi-destination branches like br_table return None.

source

pub fn trap_code(&self) -> Option<TrapCode>

If this is a trapping instruction, get its trap code. Otherwise, return None.

source

pub fn cond_code(&self) -> Option<IntCC>

If this is a control-flow instruction depending on an integer condition, gets its condition. Otherwise, return None.

source

pub fn fp_cond_code(&self) -> Option<FloatCC>

If this is a control-flow instruction depending on a floating-point condition, gets its condition. Otherwise, return None.

source

pub fn trap_code_mut(&mut self) -> Option<&mut TrapCode>

If this is a trapping instruction, get an exclusive reference to its trap code. Otherwise, return None.

source

pub fn atomic_rmw_op(&self) -> Option<AtomicRmwOp>

If this is an atomic read/modify/write instruction, return its subopcode.

source

pub fn load_store_offset(&self) -> Option<i32>

If this is a load/store instruction, returns its immediate offset.

source

pub fn memflags(&self) -> Option<MemFlags>

If this is a load/store instruction, return its memory flags.

source

pub fn stack_slot(&self) -> Option<StackSlot>

If this instruction references a stack slot, return it

source

pub fn analyze_call<'a>(&'a self, pool: &'a ValueListPool) -> CallInfo<'a>

Return information about a call instruction.

Any instruction that can call another function reveals its call signature here.

Trait Implementations§

source§

impl Clone for InstructionData

source§

fn clone(&self) -> InstructionData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstructionData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a InstructionData> for InstructionFormat

source§

fn from(inst: &'a InstructionData) -> Self

Converts to this type from the input type.
source§

impl Hash for InstructionData

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<InstructionData> for InstructionData

source§

fn eq(&self, other: &InstructionData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for InstructionData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.