pub struct BasicBlock {
pub name: String,
pub body: Vec<InstrId>,
pub terminator: Option<InstrId>,
}Expand description
A basic block within a function.
The block owns a list of non-terminator InstrIds (the body) and an
optional terminator InstrId. All InstrIds index into the owning
Function’s flat instructions pool.
Fields§
§name: StringPublic API for name.
body: Vec<InstrId>Non-terminator instructions, in order.
terminator: Option<InstrId>The terminator instruction, if present.
Implementations§
Source§impl BasicBlock
impl BasicBlock
Sourcepub fn append_instr(&mut self, id: InstrId)
pub fn append_instr(&mut self, id: InstrId)
Append a non-terminator instruction.
Sourcepub fn set_terminator(&mut self, id: InstrId)
pub fn set_terminator(&mut self, id: InstrId)
Set the terminator instruction (replaces any existing one).
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
True if the block has a terminator.
Trait Implementations§
Source§impl Clone for BasicBlock
impl Clone for BasicBlock
Source§fn clone(&self) -> BasicBlock
fn clone(&self) -> BasicBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BasicBlock
impl RefUnwindSafe for BasicBlock
impl Send for BasicBlock
impl Sync for BasicBlock
impl Unpin for BasicBlock
impl UnsafeUnpin for BasicBlock
impl UnwindSafe for BasicBlock
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