Skip to content

Commit

Permalink
Partial explanation of Rust instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws committed Jul 31, 2024
1 parent f934614 commit 9cab108
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rfc/src/rfcs/0011-source-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,18 @@ discuss in [Future possibilities](#future-possibilities).

#### Understanding the Rust coverage instrumentation

The LLVM coverage instrumentation is implemented in the Rust compiler as a
[MIR pass called `InstrumentCoverage`](https://rustc-dev-guide.rust-lang.org/llvm-coverage-instrumentation.html#mir-pass-instrumentcoverage).

**Note: Explain what result is important for Kani first**

The MIR pass first builds a coverage-specific version of the MIR Control Flow
Graph (CFG) from the MIR. The initial version of this CFG is based on the MIR's
`BasicBlock`s, which then gets refined by combining blocks that can be chained
from a coverage-relevant point of view. The final version of the coverage CFG
can then be used to compute the mix of `Counter`s and `Expression`s that
represent the coverage information.

#### Integrating the instrumentation into Kani

### The default coverage workflow
Expand Down

0 comments on commit 9cab108

Please sign in to comment.