[llvm] llvm-cov: Calculate RegionCoverage based on `CoverageData::Segments` (PR #121191)

Jessica Paquette via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 5 20:44:00 PST 2025


================
@@ -63,14 +63,15 @@ auto sumMCDCPairs(const ArrayRef<MCDCRecord> &Records) {
 }
 
 static std::pair<RegionCoverageInfo, LineCoverageInfo>
-sumRegions(ArrayRef<CountedRegion> CodeRegions, const CoverageData &CD) {
+sumRegions(const CoverageData &CD) {
   // Compute the region coverage.
   size_t NumCodeRegions = 0, CoveredRegions = 0;
-  for (auto &CR : CodeRegions) {
-    if (CR.Kind != CounterMappingRegion::CodeRegion)
+  for (auto I = CD.begin(), E = CD.end(); I != E; ++I) {
----------------
ornata wrote:

it's not possible to keep this as a range-based for?

https://github.com/llvm/llvm-project/pull/121191


More information about the llvm-commits mailing list