Struct BasicBlock

Source
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>

Source

pub fn new(id: usize, name: Option<&str>) -> Self

Construct a new BasicBlock.

Source

pub fn add_in_edge(&'f mut self, bb: &'f BasicBlock<'f>, edge_type: EdgeType)

Add an edge that points to this basic block.

Source

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§

Source§

impl<'f> Debug for BasicBlock<'f>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.