[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 14:46:49 PST 2024


================
@@ -1282,8 +1283,14 @@ class SegmentBuilder {
       // value for that area.
       // We add counts of the regions of the same kind as the active region
       // to handle the both situations.
-      if (I->Kind == Active->Kind)
-        Active->ExecutionCount += I->ExecutionCount;
+      if (I->Kind == Active->Kind) {
+        assert(I->HasSingleByteCoverage == Active->HasSingleByteCoverage &&
+               "Regions are generated in different coverage modes");
----------------
petrhosek wrote:

This is just a minor nit that I just noticed and could be addressed in some follow up change, but in all other `assert` cases the message is not capitalized so shouldn't capitalize here either for consistency.

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


More information about the cfe-commits mailing list