pub struct BasicBlock<'f> {
pub id: usize,
pub name: Option<String>,
pub instructions: Vec<&'f Box<dyn Instruction>>,
pub in_edges: Vec<BasicBlockEdge<'f>>,
pub out_edges: Vec<BasicBlockEdge<'f>>,
}
Expand description
A basic block is a sequence of instructions with no inward-bound branches except to the entry point and no outward-bound branches except at the exit.
Fields§
§id: usize
The ID # for this basic block. This is artificial information and not something from the disassembly.
name: Option<String>
The name of the basic block. Not all blocks have meaningful names.
instructions: Vec<&'f Box<dyn Instruction>>
The instructions within this basic block.
in_edges: Vec<BasicBlockEdge<'f>>
The basic blocks that point to this one.
out_edges: Vec<BasicBlockEdge<'f>>
The basic blocks which can be exited to from this one.
Implementations§
Source§impl<'f> BasicBlock<'f>
impl<'f> BasicBlock<'f>
Sourcepub fn add_in_edge(&'f mut self, bb: &'f BasicBlock<'f>, edge_type: EdgeType)
pub fn add_in_edge(&'f mut self, bb: &'f BasicBlock<'f>, edge_type: EdgeType)
Add an edge that points to this basic block.
Sourcepub fn add_out_edge(&'f mut self, bb: &'f BasicBlock<'f>, edge_type: EdgeType)
pub fn add_out_edge(&'f mut self, bb: &'f BasicBlock<'f>, edge_type: EdgeType)
Add an edge that points from this basic block to another.
Trait Implementations§
Auto Trait Implementations§
impl<'f> Freeze for BasicBlock<'f>
impl<'f> !RefUnwindSafe for BasicBlock<'f>
impl<'f> !Send for BasicBlock<'f>
impl<'f> !Sync for BasicBlock<'f>
impl<'f> Unpin for BasicBlock<'f>
impl<'f> !UnwindSafe for BasicBlock<'f>
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