coverage: Flatten the functions for extracting/refining coverage spans

Consolidating this code into flatter functions reduces the amount of
pointer-chasing required to read and modify it.
This commit is contained in:
Zalathar 2024-01-24 12:40:31 +11:00
parent 83ef18cd6c
commit 572d7e9e69
3 changed files with 53 additions and 74 deletions

View file

@ -73,7 +73,7 @@ fn instrument_function_for_coverage<'tcx>(tcx: TyCtxt<'tcx>, mir_body: &mut mir:
////////////////////////////////////////////////////
// Compute coverage spans from the `CoverageGraph`.
let Some(coverage_spans) =
CoverageSpans::generate_coverage_spans(mir_body, &hir_info, &basic_coverage_blocks)
spans::generate_coverage_spans(mir_body, &hir_info, &basic_coverage_blocks)
else {
// No relevant spans were found in MIR, so skip instrumenting this function.
return;