Enum BtInstruction

pub enum BtInstruction {
Show 24 variants Return(Option<BtValue>), SignExtend { src: BtValue, dst: BtValue, }, ZeroExtend { src: BtValue, dst: BtValue, }, Truncate { src: BtValue, dst: BtValue, }, TruncateTo1Bit { src: BtValue, dst: BtValue, }, ConvertFp { src: BtValue, dst: BtValue, }, FpToSignedInteger { src: BtValue, dst: BtValue, }, FpToUnsignedInteger { src: BtValue, dst: BtValue, }, SignedIntegerToFp { src: BtValue, dst: BtValue, }, UnsignedIntegerToFp { src: BtValue, dst: BtValue, }, Unary { op: BtUnaryOp, src: BtValue, dst: BtValue, }, Binary { op: BtBinaryOp, src1: BtValue, src2: BtValue, dst: BtValue, }, Copy { src: BtValue, dst: BtValue, }, Load { src_ptr: BtValue, dst: BtValue, }, Store { src: BtValue, dst_ptr: BtValue, }, StoreAddress { src: BtValue, dst_ptr: BtValue, }, StoreAtOffset { src: BtValue, dst_ptr: BtValue, dst_offset: usize, }, AddPtr { src_ptr: BtValue, index: BtValue, scale: usize, dst_ptr: BtValue, }, Jump { target: BtLabelIdentifier, }, JumpIfZero { condition: BtValue, target: BtLabelIdentifier, }, JumpIfNotZero { condition: BtValue, target: BtLabelIdentifier, }, Label { id: BtLabelIdentifier, }, Switch { controlling_value: BtValue, cases: Vec<BtSwitchCase>, default_label: Option<BtLabelIdentifier>, break_label: BtLabelIdentifier, }, FunctionCall { designator: BtValue, args: Vec<BtValue>, dst: Option<BtValue>, },
}
Expand description

A BlueTac IR instruction.

Variants§

§

Return(Option<BtValue>)

§

SignExtend

Fields

§

ZeroExtend

Fields

§

Truncate

Fields

§

TruncateTo1Bit

Fields

§

ConvertFp

Fields

§

FpToSignedInteger

Fields

§

FpToUnsignedInteger

Fields

§

SignedIntegerToFp

Fields

§

UnsignedIntegerToFp

Fields

§

Unary

Fields

§

Binary

Fields

§src1: BtValue
§src2: BtValue
§

Copy

Fields

§

Load

Fields

§src_ptr: BtValue
§

Store

Fields

§dst_ptr: BtValue
§

StoreAddress

Fields

§dst_ptr: BtValue
§

StoreAtOffset

Fields

§dst_ptr: BtValue
§dst_offset: usize
§

AddPtr

Fields

§src_ptr: BtValue
§index: BtValue
§scale: usize
§dst_ptr: BtValue
§

Jump

Fields

§

JumpIfZero

Fields

§condition: BtValue
§

JumpIfNotZero

Fields

§condition: BtValue
§

Label

§

Switch

Fields

§controlling_value: BtValue
§default_label: Option<BtLabelIdentifier>
§break_label: BtLabelIdentifier
§

FunctionCall

Fields

§designator: BtValue
§args: Vec<BtValue>

Trait Implementations§

§

impl Debug for BtInstruction

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.