[−][src]Module rustc_mir::transform::instrument_coverage

Structs

BasicCoverageBlock

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

BasicCoverageBlocks
CoverageSpan

A BCB is deconstructed into one or more Spans. Each Span maps to a CoverageSpan that references the originating BCB and one or more MIR Statements and/or Terminators. Initially, the Spans come from the Statements and Terminators, but subsequent transforms can combine adjacent Spans and CoverageSpan from the same BCB, merging the CoverageStatement vectors, and the Spans to cover the extent of the combined Spans.

CoverageSpanRefinery
CoverageVisitor

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.

InstrumentCoverage

Inserts StatementKind::Coverage statements that either instrument the binary with injected counters, via intrinsic llvm.instrprof.increment, and/or inject metadata used during codegen to construct the coverage map.

Instrumentor
ShortCircuitPreorder

Enums

CoverageStatement

Constants

ID_SEPARATOR

Functions

coverageinfo_from_mir
filtered_statement_span
filtered_terminator_span
hash
hash_mir_source
hir_body
make_code_region

Convert the Span into its file name, start line and column, and end line and column

provide

The query provider for CoverageInfo, requested by codegen_coverage() (to inject each counter) and FunctionCoverage::new() (to extract the coverage map metadata from the MIR).

source_info_span
term_type