diff options
| author | bors <bors@rust-lang.org> | 2024-11-29 05:38:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-29 05:38:09 +0000 |
| commit | cb2bd2bb06380896368b0edb02ada0117cc856be (patch) | |
| tree | cac4e7fecc42826380d0aa727871da25bf8cf488 /compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs | |
| parent | d6f88291f3ce96375683acc62d54710add042f98 (diff) | |
| parent | 9461f4296ffcbd75440ec211ead7bff6fb86012c (diff) | |
| download | rust-cb2bd2bb06380896368b0edb02ada0117cc856be.tar.gz rust-cb2bd2bb06380896368b0edb02ada0117cc856be.zip | |
Auto merge of #133608 - Zalathar:spans-revert, r=jieyouxu
Revert #133418 (Store coverage source regions as `Span`) due to regression #133606 This reverts commit adf9b5fcd1de43eaf0a779e10612caee8b47bede, reversing changes made to af1ca153d4aed5ffe22445273aa388a8d3f8f4ae. Reverting #133418 due to regressions reported at #133606. r? jieyouxu
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs index 95746b88ced..e3c0df27883 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs @@ -3,9 +3,9 @@ use rustc_data_structures::fx::FxIndexSet; use rustc_index::bit_set::BitSet; use rustc_middle::mir::coverage::{ CounterId, CovTerm, Expression, ExpressionId, FunctionCoverageInfo, Mapping, MappingKind, Op, + SourceRegion, }; use rustc_middle::ty::Instance; -use rustc_span::Span; use tracing::{debug, instrument}; use crate::coverageinfo::ffi::{Counter, CounterExpression, ExprKind}; @@ -220,16 +220,16 @@ impl<'tcx> FunctionCoverage<'tcx> { }) } - /// Yields all this function's coverage mappings, after simplifying away - /// unused counters and counter expressions. - pub(crate) fn mapping_spans( + /// Converts this function's coverage mappings into an intermediate form + /// that will be used by `mapgen` when preparing for FFI. + pub(crate) fn counter_regions( &self, - ) -> impl Iterator<Item = (MappingKind, Span)> + ExactSizeIterator + Captures<'_> { + ) -> impl Iterator<Item = (MappingKind, &SourceRegion)> + ExactSizeIterator { self.function_coverage_info.mappings.iter().map(move |mapping| { - let &Mapping { ref kind, span } = mapping; + let Mapping { kind, source_region } = mapping; let kind = kind.map_terms(|term| if self.is_zero_term(term) { CovTerm::Zero } else { term }); - (kind, span) + (kind, source_region) }) } |
