Struct sway_ir::instruction::InstructionInserter
source · [−]pub struct InstructionInserter<'a> { /* private fields */ }
Expand description
Provide a context for appending new Instruction
s to a Block
.
Implementations
sourceimpl<'a> InstructionInserter<'a>
impl<'a> InstructionInserter<'a>
sourcepub fn new(context: &'a mut Context, block: Block) -> InstructionInserter<'a>
pub fn new(context: &'a mut Context, block: Block) -> InstructionInserter<'a>
Return a new InstructionInserter
context for block
.
sourcepub fn asm_block(
self,
args: Vec<AsmArg>,
body: Vec<AsmInstruction>,
return_type: Type,
return_name: Option<Ident>
) -> Value
pub fn asm_block(
self,
args: Vec<AsmArg>,
body: Vec<AsmInstruction>,
return_type: Type,
return_name: Option<Ident>
) -> Value
Append a new Instruction::AsmBlock
from args
and a body
.
pub fn asm_block_from_asm(self, asm: AsmBlock, args: Vec<AsmArg>) -> Value
pub fn addr_of(self, value: Value) -> Value
pub fn bitcast(self, value: Value, ty: Type) -> Value
pub fn int_to_ptr(self, value: Value, ty: Type) -> Value
pub fn branch(self, to_block: Block, phi_value: Option<Value>) -> Value
pub fn call(self, function: Function, args: &[Value]) -> Value
pub fn cmp(self, pred: Predicate, lhs_value: Value, rhs_value: Value) -> Value
pub fn conditional_branch(
self,
cond_value: Value,
true_block: Block,
false_block: Block,
phi_value: Option<Value>
) -> Value
pub fn contract_call(
self,
return_type: Type,
name: String,
params: Value,
coins: Value,
asset_id: Value,
gas: Value
) -> Value
pub fn extract_element(
self,
array: Value,
ty: Aggregate,
index_val: Value
) -> Value
pub fn extract_value(
self,
aggregate: Value,
ty: Aggregate,
indices: Vec<u64>
) -> Value
pub fn get_storage_key(self) -> Value
pub fn gtf(self, index: Value, tx_field_id: u64) -> Value
pub fn get_ptr(self, base_ptr: Pointer, ptr_ty: Type, offset: u64) -> Value
pub fn insert_element(
self,
array: Value,
ty: Aggregate,
value: Value,
index_val: Value
) -> Value
pub fn insert_value(
self,
aggregate: Value,
ty: Aggregate,
value: Value,
indices: Vec<u64>
) -> Value
pub fn load(self, src_val: Value) -> Value
pub fn nop(self) -> Value
pub fn read_register(self, reg: Register) -> Value
pub fn ret(self, value: Value, ty: Type) -> Value
pub fn state_load_quad_word(self, load_val: Value, key: Value) -> Value
pub fn state_load_word(self, key: Value) -> Value
pub fn state_store_quad_word(self, stored_val: Value, key: Value) -> Value
pub fn state_store_word(self, stored_val: Value, key: Value) -> Value
pub fn store(self, dst_val: Value, stored_val: Value) -> Value
Auto Trait Implementations
impl<'a> RefUnwindSafe for InstructionInserter<'a>
impl<'a> Send for InstructionInserter<'a>
impl<'a> Sync for InstructionInserter<'a>
impl<'a> Unpin for InstructionInserter<'a>
impl<'a> !UnwindSafe for InstructionInserter<'a>
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