pub enum Instr {
Show 36 variants
Void,
Invalid,
Const(Const),
Alloca(Type),
LogicalNot(OpId),
Call {
arguments: SmallVec<[OpId; 2]>,
generic_arguments: Vec<Type>,
func: FuncId,
},
ExternCall {
arguments: SmallVec<[OpId; 2]>,
func: ExternFunctionRef,
},
FunctionRef {
generic_arguments: Vec<Type>,
func: FuncId,
},
Intrinsic {
arguments: SmallVec<[OpId; 2]>,
ty: Type,
intr: Intrinsic,
},
Import(OpId),
Reinterpret(OpId, Type),
Truncate(OpId, Type),
SignExtend(OpId, Type),
ZeroExtend(OpId, Type),
FloatCast(OpId, Type),
FloatToInt(OpId, Type),
IntToFloat(OpId, Type),
Load(OpId),
Store {
location: OpId,
value: OpId,
},
AddressOfStatic(StaticId),
Pointer {
op: OpId,
is_mut: bool,
},
Struct {
fields: SmallVec<[OpId; 2]>,
id: StructId,
},
Enum {
variants: SmallVec<[OpId; 2]>,
id: EnumId,
},
FunctionTy {
param_tys: Vec<OpId>,
ret_ty: OpId,
},
StructLit {
fields: SmallVec<[OpId; 2]>,
id: StructId,
},
DirectFieldAccess {
val: OpId,
index: usize,
},
IndirectFieldAccess {
val: OpId,
index: usize,
},
InternalFieldAccess {
val: OpId,
field: InternalField,
},
Variant {
enuum: EnumId,
index: usize,
payload: OpId,
},
DiscriminantAccess {
val: OpId,
},
Ret(OpId),
Br(BlockId),
CondBr {
condition: OpId,
true_bb: BlockId,
false_bb: BlockId,
},
SwitchBr {
scrutinee: OpId,
cases: Vec<SwitchCase>,
catch_all_bb: BlockId,
},
GenericParam(GenericParamId),
Parameter(Type),
}
Variants
Void
Invalid
Const(Const)
Alloca(Type)
LogicalNot(OpId)
Call
ExternCall
FunctionRef
Intrinsic
Import(OpId)
Reinterpret(OpId, Type)
Truncate(OpId, Type)
SignExtend(OpId, Type)
ZeroExtend(OpId, Type)
FloatCast(OpId, Type)
FloatToInt(OpId, Type)
IntToFloat(OpId, Type)
Load(OpId)
Store
AddressOfStatic(StaticId)
Pointer
Struct
Enum
FunctionTy
StructLit
DirectFieldAccess
IndirectFieldAccess
InternalFieldAccess
Variant
DiscriminantAccess
Fields
val: OpId
Ret(OpId)
Br(BlockId)
CondBr
SwitchBr
GenericParam(GenericParamId)
Parameter(Type)
Only valid at the beginning of a function, right after the void instruction
Implementations
sourceimpl Instr
impl Instr
pub fn replace_bb(&mut self, old: BlockId, new: BlockId)
pub fn referenced_values(&self) -> Vec<OpId>
pub fn references_value(&self, val: OpId) -> bool
pub fn replace_value(&mut self, old: OpId, new: OpId)
Trait Implementations
impl StructuralPartialEq for Instr
Auto Trait Implementations
impl RefUnwindSafe for Instr
impl Send for Instr
impl Sync for Instr
impl Unpin for Instr
impl UnwindSafe for Instr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more