Skip to main content

Cfg

Struct Cfg 

Source
pub struct Cfg {
    pub blocks: Vec<Block>,
    pub entry: usize,
    pub exc_edges: Vec<ExcEdge>,
    pub exc_ranges: Vec<ExcRange>,
    /* private fields */
}

Fields§

§blocks: Vec<Block>§entry: usize§exc_edges: Vec<ExcEdge>§exc_ranges: Vec<ExcRange>

Implementations§

Source§

impl Cfg

Source

pub fn from_blocks( blocks: Vec<Block>, entry: usize, exc_ranges: Vec<ExcRange>, ) -> Cfg

Assemble a CFG from front-end-built blocks. Predecessor lists, handler lists and exception edges are derived here so a front-end only has to state successors and exception ranges.

Source

pub fn from_parts( blocks: Vec<Block>, entry: usize, exc_ranges: Vec<ExcRange>, exc_edges: Vec<ExcEdge>, ) -> Cfg

Assemble a CFG from blocks the caller has already filled in: pred and handlers are taken as given and exc_edges is supplied, so no derivation runs.

This is the constructor for a front-end that is mirroring a graph it already maintains (jcdc’s Cfg::to_core): the derivation above would only be thrown away, and at four to five snapshots per method that waste — plus the allocate-then-replace churn of the derived lists — is measurable.

Source

pub fn block_at(&self, p: u32) -> Option<usize>

Block containing machine offset p.

Source

pub fn len(&self) -> usize

Number of blocks.

Source

pub fn is_empty(&self) -> bool

Source

pub fn starts_partition(&self, p: u32) -> usize

Index of the first block whose start >= p (starts are sorted).

Source

pub fn is_block_start(&self, p: u32) -> bool

True if p starts a block.

Auto Trait Implementations§

§

impl Freeze for Cfg

§

impl RefUnwindSafe for Cfg

§

impl Send for Cfg

§

impl Sync for Cfg

§

impl Unpin for Cfg

§

impl UnsafeUnpin for Cfg

§

impl UnwindSafe for Cfg

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.