Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e9b017

Browse files
committedJan 24, 2025
Auto merge of #136000 - matthiaskrgr:rollup-j6ge32r, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #135873 (coverage: Prepare for upcoming changes to counter creation) - #135926 (Implement `needs-subprocess` directive, and cleanup a bunch of tests to use `needs-{subprocess,threads}`) - #135950 (Tidy Python improvements) - #135956 (Make `Vec::pop_if` a bit more presentable) - #135966 ([AIX] Allow different sized load and store in `tests/assembly/powerpc64-struct-abi.rs`) - #135983 (Doc difference between extend and extend_from_slice) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8231e85 + ed77bf7 commit 1e9b017

File tree

233 files changed

+595
-608
lines changed

Some content is hidden

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

233 files changed

+595
-608
lines changed
 

‎compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub(crate) fn prepare_covfun_record<'tcx>(
5151
is_used: bool,
5252
) -> Option<CovfunRecord<'tcx>> {
5353
let fn_cov_info = tcx.instance_mir(instance.def).function_coverage_info.as_deref()?;
54-
let ids_info = tcx.coverage_ids_info(instance.def);
54+
let ids_info = tcx.coverage_ids_info(instance.def)?;
5555

5656
let expressions = prepare_expressions(fn_cov_info, ids_info, is_used);
5757

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use rustc_codegen_ssa::traits::{
88
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
99
use rustc_middle::mir::coverage::CoverageKind;
1010
use rustc_middle::ty::Instance;
11-
use rustc_middle::ty::layout::HasTyCtxt;
1211
use tracing::{debug, instrument};
1312

1413
use crate::builder::Builder;
@@ -147,6 +146,10 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> {
147146
debug!("function has a coverage statement but no coverage info");
148147
return;
149148
};
149+
let Some(ids_info) = bx.tcx.coverage_ids_info(instance.def) else {
150+
debug!("function has a coverage statement but no IDs info");
151+
return;
152+
};
150153

151154
// Mark the instance as used in this CGU, for coverage purposes.
152155
// This includes functions that were not partitioned into this CGU,
@@ -162,8 +165,7 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> {
162165
// be smaller than the number originally inserted by the instrumentor,
163166
// if some high-numbered counters were removed by MIR optimizations.
164167
// If so, LLVM's profiler runtime will use fewer physical counters.
165-
let num_counters =
166-
bx.tcx().coverage_ids_info(instance.def).num_counters_after_mir_opts();
168+
let num_counters = ids_info.num_counters_after_mir_opts();
167169
assert!(
168170
num_counters as usize <= function_coverage_info.num_counters,
169171
"num_counters disagreement: query says {num_counters} but function info only has {}",

0 commit comments

Comments
 (0)
Please sign in to comment.