pub enum IrInstruction {
Const {
dst: IrValueId,
literal: Literal,
},
LoadLocal {
dst: IrValueId,
local: IrLocalId,
},
StoreLocal {
local: IrLocalId,
value: IrValueId,
},
LoadGlobal {
dst: IrValueId,
name: String,
},
StoreGlobal {
name: String,
value: IrValueId,
},
Unary {
dst: IrValueId,
op: UnaryOp,
operand: IrValueId,
},
Binary {
dst: IrValueId,
op: BinaryOp,
left: IrValueId,
right: IrValueId,
},
Assignment {
dst: IrValueId,
op: AssignmentOp,
left: IrValueId,
right: IrValueId,
},
Call {
dst: Option<IrValueId>,
function: String,
arguments: Vec<IrCallArgument>,
},
FieldLoad {
dst: IrValueId,
base: IrValueId,
field: String,
},
FieldStore {
base: IrValueId,
field: String,
value: IrValueId,
},
}Expand description
One stack-oriented IR instruction.
Variants§
Const
Materialize one literal.
LoadLocal
Load one local.
StoreLocal
Store one local.
LoadGlobal
Load one global.
StoreGlobal
Store one global.
Unary
Apply one unary operator.
Binary
Apply one binary operator.
Fields
Assignment
Apply one assignment operator in-place.
Fields
§
op: AssignmentOpOperator.
Call
Call one function or builtin by name.
Fields
§
arguments: Vec<IrCallArgument>Argument payloads in source order.
FieldLoad
Load one structure field.
FieldStore
Store one structure field.
Trait Implementations§
Source§impl Clone for IrInstruction
impl Clone for IrInstruction
Source§fn clone(&self) -> IrInstruction
fn clone(&self) -> IrInstruction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IrInstruction
impl Debug for IrInstruction
Source§impl<'de> Deserialize<'de> for IrInstruction
impl<'de> Deserialize<'de> for IrInstruction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for IrInstruction
impl PartialEq for IrInstruction
Source§impl Serialize for IrInstruction
impl Serialize for IrInstruction
impl StructuralPartialEq for IrInstruction
Auto Trait Implementations§
impl Freeze for IrInstruction
impl RefUnwindSafe for IrInstruction
impl Send for IrInstruction
impl Sync for IrInstruction
impl Unpin for IrInstruction
impl UnsafeUnpin for IrInstruction
impl UnwindSafe for IrInstruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more