pub struct BasicBlock {
pub id: BlockId,
pub start_offset: usize,
pub end_offset: usize,
pub instruction_range: Range<usize>,
pub terminator: Terminator,
}Expand description
A basic block: a sequence of instructions with single entry and exit.
Fields§
§id: BlockIdUnique identifier for this block.
start_offset: usizeStarting bytecode offset of this block.
end_offset: usizeEnding bytecode offset (exclusive) of this block.
instruction_range: Range<usize>Instructions in this block (references by offset range).
terminator: TerminatorHow this block terminates.
Implementations§
Source§impl BasicBlock
impl BasicBlock
Sourcepub fn new(
id: BlockId,
start_offset: usize,
end_offset: usize,
instruction_range: Range<usize>,
terminator: Terminator,
) -> Self
pub fn new( id: BlockId, start_offset: usize, end_offset: usize, instruction_range: Range<usize>, terminator: Terminator, ) -> Self
Create a new basic block.
Sourcepub fn contains_offset(&self, offset: usize) -> bool
pub fn contains_offset(&self, offset: usize) -> bool
Check if this block contains the given offset.
Sourcepub fn instruction_count(&self) -> usize
pub fn instruction_count(&self) -> usize
Get the number of instructions in this block.
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 · 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 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