pub struct CraneliftFunctionBuilder { /* private fields */ }Expand description
Fluent builder for constructing CraneliftFunction objects.
Implementations§
Source§impl CraneliftFunctionBuilder
impl CraneliftFunctionBuilder
Sourcepub fn new(name: impl Into<String>, sig: Signature) -> Self
pub fn new(name: impl Into<String>, sig: Signature) -> Self
Create a new builder for the named function with given signature.
Sourcepub fn create_entry_block(self) -> Self
pub fn create_entry_block(self) -> Self
Create an entry block and set it as current.
Sourcepub fn create_block(self) -> (Self, u32)
pub fn create_block(self) -> (Self, u32)
Create a new block and set it as current.
Sourcepub fn switch_to_block(self, block: u32) -> Self
pub fn switch_to_block(self, block: u32) -> Self
Switch to an existing block.
Sourcepub fn ins_result(
self,
ty: CraneliftType,
instr: CraneliftInstr,
) -> (Self, CraneliftValue)
pub fn ins_result( self, ty: CraneliftType, instr: CraneliftInstr, ) -> (Self, CraneliftValue)
Emit a value-producing instruction in the current block.
Sourcepub fn ins_void(self, instr: CraneliftInstr) -> Self
pub fn ins_void(self, instr: CraneliftInstr) -> Self
Emit a void (side-effecting) instruction in the current block.
Sourcepub fn block_param(self, ty: CraneliftType) -> (Self, CraneliftValue)
pub fn block_param(self, ty: CraneliftType) -> (Self, CraneliftValue)
Add a block parameter to the current block.
Sourcepub fn finish(self) -> CraneliftFunction
pub fn finish(self) -> CraneliftFunction
Consume the builder and return the completed function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CraneliftFunctionBuilder
impl RefUnwindSafe for CraneliftFunctionBuilder
impl Send for CraneliftFunctionBuilder
impl Sync for CraneliftFunctionBuilder
impl Unpin for CraneliftFunctionBuilder
impl UnsafeUnpin for CraneliftFunctionBuilder
impl UnwindSafe for CraneliftFunctionBuilder
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