pub struct Instruction {
pub id: InstId,
pub op: Operation,
pub operands: Vec<ValueId>,
pub dst: Option<ValueId>,
pub span: Option<Span>,
pub symbol: Option<Symbol>,
pub result_type: Option<TypeId>,
pub extensions: BTreeMap<String, Value>,
}Expand description
An AIR instruction.
Fields§
§id: InstIdUnique instruction identifier.
op: OperationThe operation performed.
operands: Vec<ValueId>Input values (operands).
dst: Option<ValueId>Output value (if the instruction produces one).
span: Option<Span>Optional source location.
symbol: Option<Symbol>Optional symbol/name information.
result_type: Option<TypeId>Type of the result value, if known. Populated by frontends with type info (e.g., LLVM).
extensions: BTreeMap<String, Value>Frontend-specific extension data. Analyses that don’t understand these extensions should ignore them.
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn with_operands(self, operands: Vec<ValueId>) -> Self
pub fn with_operands(self, operands: Vec<ValueId>) -> Self
Add operands to the instruction.
Sourcepub fn with_symbol(self, symbol: Symbol) -> Self
pub fn with_symbol(self, symbol: Symbol) -> Self
Set the symbol.
Sourcepub fn is_terminator(&self) -> bool
pub fn is_terminator(&self) -> bool
Check if this is a terminator instruction.
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
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 Instruction
impl Debug for Instruction
Source§impl<'de> Deserialize<'de> for Instruction
impl<'de> Deserialize<'de> for Instruction
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 Instruction
impl PartialEq for Instruction
Source§impl Serialize for Instruction
impl Serialize for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnsafeUnpin for Instruction
impl UnwindSafe for Instruction
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