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
impl Cfg
Sourcepub fn from_blocks(
blocks: Vec<Block>,
entry: usize,
exc_ranges: Vec<ExcRange>,
) -> Cfg
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.
Sourcepub fn from_parts(
blocks: Vec<Block>,
entry: usize,
exc_ranges: Vec<ExcRange>,
exc_edges: Vec<ExcEdge>,
) -> Cfg
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.
pub fn is_empty(&self) -> bool
Sourcepub fn starts_partition(&self, p: u32) -> usize
pub fn starts_partition(&self, p: u32) -> usize
Index of the first block whose start >= p (starts are sorted).
Sourcepub fn is_block_start(&self, p: u32) -> bool
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> 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