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_name: Option<Ident>
) -> Value
pub fn asm_block(
self,
args: Vec<AsmArg>,
body: Vec<AsmInstruction>,
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 branch(self, to_block: Block, phi_value: Option<Value>) -> Value
pub fn call(self, function: Function, args: &[Value]) -> Value
pub fn conditional_branch(
self,
cond_value: Value,
true_block: Block,
false_block: Block,
phi_value: Option<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_ptr(self, ptr: Pointer) -> 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, ptr: Pointer) -> Value
pub fn ret(self, value: Value, ty: Type) -> Value
pub fn store(self, ptr: Pointer, 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more