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

struct CoverageVisitor {
    info: CoverageInfo,
}

The num_counters argument to llvm.instrprof.increment is the max counter_id + 1, or in other words, the number of counter value references injected into the MIR (plus 1 for the reserved ZERO counter, which uses counter ID 0 when included in an expression). Injected counters have a counter ID from 1..num_counters-1.

num_expressions is the number of counter expressions added to the MIR body.

Both num_counters and num_expressions are used to initialize new vectors, during backend code generate, to lookup counters and expressions by simple u32 indexes.

MIR optimization may split and duplicate some BasicBlock sequences, or optimize out some code including injected counters. (It is OK if some counters are optimized out, but those counters are still included in the total num_counters or num_expressions.) Simply counting the calls may not work; but computing the number of counters or expressions by adding 1 to the highest ID (for a given instrumented function) is valid.

Fields

info: CoverageInfo

Trait Implementations

impl<'_> Visitor<'_> for CoverageVisitor[src]

Auto Trait Implementations

impl RefUnwindSafe for CoverageVisitor

impl Send for CoverageVisitor

impl Sync for CoverageVisitor

impl Unpin for CoverageVisitor

impl UnwindSafe for CoverageVisitor

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, 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]