Skip to content

Commit 8700ba1

Browse files
committedDec 19, 2024
Auto merge of #134516 - matthiaskrgr:rollup-aqwxii0, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #134463 (compiletest: don't register predefined `MSVC`/`NONMSVC` FileCheck prefixes) - #134487 (Add reference annotations for the `coverage` attribute) - #134497 (coverage: Store coverage source regions as `Span` until codegen (take 2)) - #134502 (Update std libc version to 0.2.169) - #134506 (Remove a duplicated check that doesn't do anything anymore.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9e136a3 + 4f053b1 commit 8700ba1

File tree

68 files changed

+531
-488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+531
-488
lines changed
 

‎Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,9 +2012,9 @@ checksum = "baff4b617f7df3d896f97fe922b64817f6cd9a756bb81d40f8883f2f66dcb401"
20122012

20132013
[[package]]
20142014
name = "libc"
2015-
version = "0.2.168"
2015+
version = "0.2.169"
20162016
source = "registry+https://github.com/rust-lang/crates.io-index"
2017-
checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d"
2017+
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
20182018

20192019
[[package]]
20202020
name = "libdbus-sys"

‎compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use rustc_middle::mir::coverage::{CounterId, CovTerm, ExpressionId, SourceRegion};
2-
3-
use crate::coverageinfo::mapgen::LocalFileId;
1+
use rustc_middle::mir::coverage::{CounterId, CovTerm, ExpressionId};
42

53
/// Must match the layout of `LLVMRustCounterKind`.
64
#[derive(Copy, Clone, Debug)]
@@ -126,30 +124,16 @@ pub(crate) struct CoverageSpan {
126124
/// Local index into the function's local-to-global file ID table.
127125
/// The value at that index is itself an index into the coverage filename
128126
/// table in the CGU's `__llvm_covmap` section.
129-
file_id: u32,
127+
pub(crate) file_id: u32,
130128

131129
/// 1-based starting line of the source code span.
132-
start_line: u32,
130+
pub(crate) start_line: u32,
133131
/// 1-based starting column of the source code span.
134-
start_col: u32,
132+
pub(crate) start_col: u32,
135133
/// 1-based ending line of the source code span.
136-
end_line: u32,
134+
pub(crate) end_line: u32,
137135
/// 1-based ending column of the source code span. High bit must be unset.
138-
end_col: u32,
139-
}
140-
141-
impl CoverageSpan {
142-
pub(crate) fn from_source_region(
143-
local_file_id: LocalFileId,
144-
code_region: &SourceRegion,
145-
) -> Self {
146-
let file_id = local_file_id.as_u32();
147-
let &SourceRegion { start_line, start_col, end_line, end_col } = code_region;
148-
// Internally, LLVM uses the high bit of `end_col` to distinguish between
149-
// code regions and gap regions, so it can't be used by the column number.
150-
assert!(end_col & (1u32 << 31) == 0, "high bit of `end_col` must be unset: {end_col:#X}");
151-
Self { file_id, start_line, start_col, end_line, end_col }
152-
}
136+
pub(crate) end_col: u32,
153137
}
154138

155139
/// Holds tables of the various region types in one struct.
@@ -184,15 +168,15 @@ impl Regions {
184168
#[derive(Clone, Debug)]
185169
#[repr(C)]
186170
pub(crate) struct CodeRegion {
187-
pub(crate) span: CoverageSpan,
171+
pub(crate) cov_span: CoverageSpan,
188172
pub(crate) counter: Counter,
189173
}
190174

191175
/// Must match the layout of `LLVMRustCoverageBranchRegion`.
192176
#[derive(Clone, Debug)]
193177
#[repr(C)]
194178
pub(crate) struct BranchRegion {
195-
pub(crate) span: CoverageSpan,
179+
pub(crate) cov_span: CoverageSpan,
196180
pub(crate) true_counter: Counter,
197181
pub(crate) false_counter: Counter,
198182
}
@@ -201,7 +185,7 @@ pub(crate) struct BranchRegion {
201185
#[derive(Clone, Debug)]
202186
#[repr(C)]
203187
pub(crate) struct MCDCBranchRegion {
204-
pub(crate) span: CoverageSpan,
188+
pub(crate) cov_span: CoverageSpan,
205189
pub(crate) true_counter: Counter,
206190
pub(crate) false_counter: Counter,
207191
pub(crate) mcdc_branch_params: mcdc::BranchParameters,
@@ -211,6 +195,6 @@ pub(crate) struct MCDCBranchRegion {
211195
#[derive(Clone, Debug)]
212196
#[repr(C)]
213197
pub(crate) struct MCDCDecisionRegion {
214-
pub(crate) span: CoverageSpan,
198+
pub(crate) cov_span: CoverageSpan,
215199
pub(crate) mcdc_decision_params: mcdc::DecisionParameters,
216200
}

0 commit comments

Comments
 (0)
Please sign in to comment.