diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-05-02 19:53:03 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-05-06 12:13:30 +1000 |
| commit | 83852d9bf359a886f2126504f929cfde3f17e62b (patch) | |
| tree | 3c9c515b7111d938653a92402c5ea7d4ab430215 /compiler/rustc_mir_transform/src/coverage/mod.rs | |
| parent | 496ae1ee1c6c9bbd820607e8b53c91f95e26ffdc (diff) | |
| download | rust-83852d9bf359a886f2126504f929cfde3f17e62b.tar.gz rust-83852d9bf359a886f2126504f929cfde3f17e62b.zip | |
coverage: Don't recompute the number of test vector bitmap bytes
The code in `extract_mcdc_mappings` that allocates these bytes already knows how many are needed in total, so there's no need to immediately recompute that value in the calling function.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/mod.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/mod.rs b/compiler/rustc_mir_transform/src/coverage/mod.rs index 5cc01b4c9b8..572502bc7bb 100644 --- a/compiler/rustc_mir_transform/src/coverage/mod.rs +++ b/compiler/rustc_mir_transform/src/coverage/mod.rs @@ -115,7 +115,7 @@ fn instrument_function_for_coverage<'tcx>(tcx: TyCtxt<'tcx>, mir_body: &mut mir: mir_body.function_coverage_info = Some(Box::new(FunctionCoverageInfo { function_source_hash: hir_info.function_source_hash, num_counters: coverage_counters.num_counters(), - mcdc_bitmap_bytes: coverage_spans.test_vector_bitmap_bytes(), + mcdc_bitmap_bytes: coverage_spans.mcdc_bitmap_bytes, expressions: coverage_counters.into_expressions(), mappings, mcdc_num_condition_bitmaps, @@ -254,10 +254,6 @@ fn inject_mcdc_statements<'tcx>( basic_coverage_blocks: &CoverageGraph, coverage_spans: &CoverageSpans, ) { - if coverage_spans.test_vector_bitmap_bytes() == 0 { - return; - } - // Inject test vector update first because `inject_statement` always insert new statement at head. for &mappings::MCDCDecision { span: _, |
