diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-05-15 07:16:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-15 07:16:48 +0200 |
| commit | a8ff937b07d4b15394032e5cc8c786988669cdb1 (patch) | |
| tree | 32c193bfcc87fe6bf50a1a8d572e3212ac063a85 /compiler/rustc_codegen_llvm/src | |
| parent | 03ff673dcc7d3e9417062cbec0a5d4d2c232f404 (diff) | |
| parent | c81be68fb49cf5798fe44cedd56cb91bdc61d011 (diff) | |
| download | rust-a8ff937b07d4b15394032e5cc8c786988669cdb1.tar.gz rust-a8ff937b07d4b15394032e5cc8c786988669cdb1.zip | |
Rollup merge of #125108 - Zalathar:info-bitmap-bytes, r=nnethercote
coverage: `CoverageIdsInfo::mcdc_bitmap_bytes` is never needed This code for recalculating `mcdc_bitmap_bytes` in a query doesn't provide any benefit, because its result won't have changed from the value in `FunctionCoverageInfo` that was computed during the MIR instrumentation pass. Extracted from #124571, to avoid having this held up by unrelated issues with condition count checks. `@rustbot` label +A-code-coverage
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index c51a7744a30..26ea95f0f0d 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -207,13 +207,8 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> { let cond_bitmap = coverage_context .try_get_mcdc_condition_bitmap(&instance, decision_depth) .expect("mcdc cond bitmap should have been allocated for merging into the global bitmap"); - let bitmap_bytes = bx.tcx().coverage_ids_info(instance.def).mcdc_bitmap_bytes; + let bitmap_bytes = function_coverage_info.mcdc_bitmap_bytes; assert!(bitmap_idx < bitmap_bytes, "bitmap index of the decision out of range"); - assert!( - bitmap_bytes <= function_coverage_info.mcdc_bitmap_bytes, - "bitmap length disagreement: query says {bitmap_bytes} but function info only has {}", - function_coverage_info.mcdc_bitmap_bytes - ); let fn_name = bx.get_pgo_func_name_var(instance); let hash = bx.const_u64(function_coverage_info.function_source_hash); |
