pub struct Block {
pub id: BlockId,
pub label: String,
pub instructions: Vec<Instruction>,
pub terminator: Option<Terminator>,
pub predecessors: Vec<BlockId>,
pub successors: Vec<BlockId>,
}Expand description
A basic block containing IR nodes.
Fields§
§id: BlockIdBlock identifier.
label: StringBlock label (for debugging).
instructions: Vec<Instruction>Instructions in this block.
terminator: Option<Terminator>Terminator instruction.
predecessors: Vec<BlockId>Predecessor blocks.
successors: Vec<BlockId>Successor blocks.
Implementations§
Source§impl Block
impl Block
Sourcepub fn add_instruction(&mut self, inst: Instruction)
pub fn add_instruction(&mut self, inst: Instruction)
Add an instruction to the block.
Sourcepub fn set_terminator(&mut self, term: Terminator)
pub fn set_terminator(&mut self, term: Terminator)
Set the terminator.
Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Check if block is terminated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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