[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

Jessica Paquette via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 00:59:09 PDT 2024


================
@@ -1709,6 +1730,13 @@ struct CounterCoverageMappingBuilder
             : addCounters(
                   addCounters(ParentCount, BackedgeCount, BodyBC.ContinueCount),
                   IncrementBC.ContinueCount);
+    auto [ExecCount, ExitCount] =
+        (llvm::EnableSingleByteCoverage
+             ? std::make_pair(getRegionCounter(S), Counter::getZero())
+             : getBranchCounterPair(S, CondCount));
+    if (!llvm::EnableSingleByteCoverage) {
----------------
ornata wrote:

wrap in `#ifndef NDEBUG`?

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


More information about the cfe-commits mailing list