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
/// 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)
683
+
/// Corresponds to enum `llvm::coverage::CounterMappingRegion::RegionKind`.
684
+
///
685
+
/// Must match the layout of `LLVMRustCounterMappingRegionKind`.
684
686
#[derive(Copy,Clone,Debug)]
685
687
#[repr(C)]
686
688
pubenumRegionKind{
@@ -714,7 +716,9 @@ pub mod coverageinfo {
714
716
/// array", encoded separately), and source location (start and end positions of the represented
715
717
/// code region).
716
718
///
717
-
/// Matches LLVMRustCounterMappingRegion.
719
+
/// Corresponds to struct `llvm::coverage::CounterMappingRegion`.
720
+
///
721
+
/// Must match the layout of `LLVMRustCounterMappingRegion`.
Copy file name to clipboardExpand all lines: compiler/rustc_codegen_ssa/src/coverageinfo/ffi.rs
+11-7
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/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L95)
3
+
/// Must match the layout of `LLVMRustCounterKind`.
4
4
#[derive(Copy,Clone,Debug)]
5
5
#[repr(C)]
6
6
pubenumCounterKind{
@@ -17,8 +17,10 @@ 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/13.0-2021-09-30/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L102-L103)
21
-
/// Important: The Rust struct layout (order and types of fields) must match its C++ counterpart.
20
+
///
21
+
/// Corresponds to struct `llvm::coverage::Counter`.
22
+
///
23
+
/// Must match the layout of `LLVMRustCounter`.
22
24
#[derive(Copy,Clone,Debug)]
23
25
#[repr(C)]
24
26
pubstructCounter{
@@ -59,17 +61,19 @@ impl Counter {
59
61
}
60
62
}
61
63
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)
64
+
/// Corresponds to enum `llvm::coverage::CounterExpression::ExprKind`.
65
+
///
66
+
/// Must match the layout of `LLVMRustCounterExprKind`.
63
67
#[derive(Copy,Clone,Debug)]
64
68
#[repr(C)]
65
69
pubenumExprKind{
66
70
Subtract = 0,
67
71
Add = 1,
68
72
}
69
73
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
-
/// Important: The Rust struct layout (order and types of fields) must match its C++
72
-
/// counterpart.
74
+
/// Corresponds to struct `llvm::coverage::CounterExpression`.
75
+
///
76
+
/// Must match the layout of `LLVMRustCounterExpression`.
0 commit comments