[PATCH] D18831: [Coverage] Use the count value of the outer region for an expansion region.

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 11:59:57 PDT 2016


davidxl added a comment.

Your little motivating examples are great -- please add them as test cases as well.


================
Comment at: llvm/trunk/lib/ProfileData/CoverageMapping.cpp:327
@@ -326,3 +326,3 @@
         if (Region.Kind == coverage::CounterMappingRegion::CodeRegion)
-          Count = Count.getValueOr(0) + Region.ExecutionCount;
+          Count = Count.getValue() + Region.ExecutionCount;
         continue;
----------------
what is this change about?

================
Comment at: llvm/trunk/lib/ProfileData/CoverageMapping.cpp:410
@@ +409,3 @@
+        // If LHS and RHS cover the same region,
+        // prefer CodeRegion to ExpansionRegion
+        // and ExpansionRegion to SkippedRegion.
----------------
Can you add a comment here with more explanation?

================
Comment at: llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp:526
@@ +525,3 @@
+
+  CoverageData Data = LoadedCoverage->getCoverageForFile("file");
+  std::vector<CoverageSegment> Segments(Data.begin(), Data.end());
----------------
Also add a test for "include".


http://reviews.llvm.org/D18831





More information about the llvm-commits mailing list