pub struct CraneliftBlock {
pub id: u32,
pub params: Vec<CraneliftValue>,
pub instrs: Vec<CraneliftInstResult>,
}Expand description
A basic block in Cranelift IR.
Fields§
§id: u32Block ID (e.g. block0, block1)
params: Vec<CraneliftValue>Block parameters (like phi nodes in SSA form — Cranelift uses explicit params)
instrs: Vec<CraneliftInstResult>Instructions in this block
Implementations§
Source§impl CraneliftBlock
impl CraneliftBlock
Sourcepub fn with_params(id: u32, params: Vec<CraneliftValue>) -> Self
pub fn with_params(id: u32, params: Vec<CraneliftValue>) -> Self
Create a block with parameters.
Sourcepub fn push_with_result(
&mut self,
result: CraneliftValue,
instr: CraneliftInstr,
)
pub fn push_with_result( &mut self, result: CraneliftValue, instr: CraneliftInstr, )
Append an instruction with a result value.
Sourcepub fn push_void(&mut self, instr: CraneliftInstr)
pub fn push_void(&mut self, instr: CraneliftInstr)
Append a void instruction.
Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Return true if this block ends with a terminator instruction.
Trait Implementations§
Source§impl Clone for CraneliftBlock
impl Clone for CraneliftBlock
Source§fn clone(&self) -> CraneliftBlock
fn clone(&self) -> CraneliftBlock
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 CraneliftBlock
impl Debug for CraneliftBlock
Source§impl PartialEq for CraneliftBlock
impl PartialEq for CraneliftBlock
impl StructuralPartialEq for CraneliftBlock
Auto Trait Implementations§
impl Freeze for CraneliftBlock
impl RefUnwindSafe for CraneliftBlock
impl Send for CraneliftBlock
impl Sync for CraneliftBlock
impl Unpin for CraneliftBlock
impl UnsafeUnpin for CraneliftBlock
impl UnwindSafe for CraneliftBlock
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