Skip to content

Commit a374e7d

Browse files
authored
Update LLVM coverage mapping format version supported by rustc (rust-lang#1267)
rust-lang#91207 updates the coverage mapping format to Version 5 or 6, depending on the built-in version of LLVM (12 or 13, respectively). This change updates the dev guide to match the recent changes.
1 parent 2cee5a9 commit a374e7d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Diff for: src/llvm-coverage-instrumentation.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,15 @@ substitution combinations), `mapgen`'s `finalize()` method queries the
221221
and `CodeRegion`s; and calls LLVM codegen APIs to generate
222222
properly-configured variables in LLVM IR, according to very specific
223223
details of the [_LLVM Coverage Mapping Format_][coverage-mapping-format]
224-
(Version 4).[^llvm-and-covmap-versions]
225-
226-
[^llvm-and-covmap-versions]: The Rust compiler (as of
227-
January 2021) supports _LLVM Coverage Mapping Format_ Version 4 (the most
228-
up-to-date version of the format, at the time of this writing) for improved
229-
compatibility with other LLVM-based compilers (like _Clang_), and to take
230-
advantage of some format optimizations. Version 4 was introduced in _LLVM 11_,
231-
which is currently the default LLVM version for Rust. Note that the Rust
232-
compiler optionally supports some earlier LLVM versions, prior to _LLVM 11_. If
233-
`rustc` is configured to use an incompatible version of LLVM, compiling with `-Z
234-
instrument-coverage` will generate an error message.
224+
(Version 6).[^llvm-and-covmap-versions]
225+
226+
[^llvm-and-covmap-versions]: The Rust compiler (as of <!-- date: 2021-12 -->
227+
December 2021) supports _LLVM Coverage Mapping Format_ Version 5 or 6. Version 5
228+
was introduced in _LLVM 12_, which is (as of this writing) the minimum LLVM
229+
version supported by the current version of Rust. Version 6 was introduced in
230+
_LLVM 13_, which is currently the default LLVM version for Rust. The Rust
231+
compiler will automatically use the most up-to-date coverage mapping format
232+
version that is compatible with the compiler's built-in version of LLVM.
235233

236234
```rust
237235
pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {

0 commit comments

Comments
 (0)