You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #91418 - matthiaskrgr:rollup-vn9f9w3, r=matthiaskrgr
Rollup of 7 pull requests
Successful merges:
- #87160 (When recovering from a `:` in a pattern, use adequate AST pattern)
- #90985 (Use `get_diagnostic_name` more)
- #91087 (Remove all migrate.nll.stderr files)
- #91207 (Add support for LLVM coverage mapping format versions 5 and 6)
- #91298 (Improve error message for `E0659` if the source is not available)
- #91346 (Add `Option::inspect` and `Result::{inspect, inspect_err}`)
- #91404 (Fix bad `NodeId` limit checking.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Copy file name to clipboardexpand all lines: compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
+32-11
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
9
9
use rustc_hir::def_id::{DefId,DefIdSet};
10
10
use rustc_llvm::RustString;
11
11
use rustc_middle::mir::coverage::CodeRegion;
12
+
use rustc_middle::ty::TyCtxt;
12
13
use rustc_span::Symbol;
13
14
14
15
use std::ffi::CString;
@@ -17,10 +18,11 @@ use tracing::debug;
17
18
18
19
/// Generates and exports the Coverage Map.
19
20
///
20
-
/// This Coverage Map complies with Coverage Mapping Format version 4 (zero-based encoded as 3),
21
-
/// as defined at [LLVM Code Coverage Mapping Format](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/docs/CoverageMappingFormat.rst#llvm-code-coverage-mapping-format)
22
-
/// and published in Rust's November 2020 fork of LLVM. This version is supported by the LLVM
23
-
/// coverage tools (`llvm-profdata` and `llvm-cov`) bundled with Rust's fork of LLVM.
/// Aligns with [llvm::coverage::CounterMappingRegion::RegionKind](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L206-L222)
688
+
/// Aligns with [llvm::coverage::CounterMappingRegion::RegionKind](https://github.com/rust-lang/llvm-project/blob/rustc/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L209-L230)
689
689
#[derive(Copy,Clone,Debug)]
690
690
#[repr(C)]
691
691
pubenumRegionKind{
@@ -704,11 +704,16 @@ pub mod coverageinfo {
704
704
/// A GapRegion is like a CodeRegion, but its count is only set as the
705
705
/// line execution count when its the only region in the line.
706
706
GapRegion = 3,
707
+
708
+
/// A BranchRegion represents leaf-level boolean expressions and is
709
+
/// associated with two counters, each representing the number of times the
710
+
/// expression evaluates to true or false.
711
+
BranchRegion = 4,
707
712
}
708
713
709
714
/// This struct provides LLVM's representation of a "CoverageMappingRegion", encoded into the
Copy file name to clipboardexpand all lines: compiler/rustc_codegen_ssa/src/coverageinfo/ffi.rs
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
use rustc_middle::mir::coverage::{CounterValueReference,MappedExpressionIndex};
2
2
3
-
/// Aligns with [llvm::coverage::Counter::CounterKind](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L206-L222)
3
+
/// Aligns with [llvm::coverage::Counter::CounterKind](https://github.com/rust-lang/llvm-project/blob/rustc/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L95)
4
4
#[derive(Copy,Clone,Debug)]
5
5
#[repr(C)]
6
6
pubenumCounterKind{
@@ -17,7 +17,7 @@ pub enum CounterKind {
17
17
/// `instrprof.increment()`)
18
18
/// * For `CounterKind::Expression`, `id` is the index into the coverage map's array of
19
19
/// counter expressions.
20
-
/// Aligns with [llvm::coverage::Counter](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L99-L100)
20
+
/// Aligns with [llvm::coverage::Counter](https://github.com/rust-lang/llvm-project/blob/rustc/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L102-L103)
21
21
/// Important: The Rust struct layout (order and types of fields) must match its C++ counterpart.
22
22
#[derive(Copy,Clone,Debug)]
23
23
#[repr(C)]
@@ -59,15 +59,15 @@ impl Counter {
59
59
}
60
60
}
61
61
62
-
/// Aligns with [llvm::coverage::CounterExpression::ExprKind](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L147)
62
+
/// Aligns with [llvm::coverage::CounterExpression::ExprKind](https://github.com/rust-lang/llvm-project/blob/rustc/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L150)
63
63
#[derive(Copy,Clone,Debug)]
64
64
#[repr(C)]
65
65
pubenumExprKind{
66
66
Subtract = 0,
67
67
Add = 1,
68
68
}
69
69
70
-
/// Aligns with [llvm::coverage::CounterExpression](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L148-L149)
70
+
/// Aligns with [llvm::coverage::CounterExpression](https://github.com/rust-lang/llvm-project/blob/rustc/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L151-L152)
71
71
/// Important: The Rust struct layout (order and types of fields) must match its C++
0 commit comments