[−][src]Struct rustc_mir::transform::instrument_coverage::BasicCoverageBlock

struct BasicCoverageBlock {
    pub blocks: Vec<BasicBlock>,
}

A BasicCoverageBlock (BCB) represents the maximal-length sequence of CFG (MIR) BasicBlocks without conditional branches.

The BCB allows coverage analysis to be performed on a simplified projection of the underlying MIR CFG, without altering the original CFG. Note that running the MIR SimplifyCfg transform, is not sufficient, and therefore not necessary, since the BCB-based CFG projection is a more aggressive simplification. For example:

Each BCB with at least one computed CoverageSpan will have no more than one Counter. In some cases, a BCB's execution count can be computed by CounterExpression. Additional disjoint CoverageSpans in a BCB can also be counted by CounterExpression (by adding ZERO to the BCB's primary counter or expression).

Dominator/dominated relationships (which are fundamental to the coverage analysis algorithm) between two BCBs can be computed using the mir::Body dominators() with any BasicBlock member of each BCB. (For consistency, BCB's use the first BasicBlock, also referred to as the bcb_leader_bb.)

The BCB CFG projection is critical to simplifying the coverage analysis by ensuring graph path-based queries (is_dominated_by(), predecessors, successors, etc.) have branch (control flow) significance.

Fields

blocks: Vec<BasicBlock>

Implementations

impl BasicCoverageBlock[src]

pub fn leader_bb(&self) -> BasicBlock[src]

pub fn id(&self) -> String[src]

Trait Implementations

impl Clone for BasicCoverageBlock[src]

impl Debug for BasicCoverageBlock[src]

Auto Trait Implementations

impl RefUnwindSafe for BasicCoverageBlock

impl Send for BasicCoverageBlock

impl Sync for BasicCoverageBlock

impl Unpin for BasicCoverageBlock

impl UnwindSafe for BasicCoverageBlock

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]