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

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


================
@@ -1645,22 +1662,26 @@ struct CounterCoverageMappingBuilder
     Counter CondCount = llvm::EnableSingleByteCoverage
                             ? getRegionCounter(S->getCond())
                             : addCounters(BackedgeCount, BC.ContinueCount);
+    auto [ExecCount, ExitCount] =
+        (llvm::EnableSingleByteCoverage
+             ? std::make_pair(getRegionCounter(S), Counter::getZero())
+             : getBranchCounterPair(S, CondCount));
+    if (!llvm::EnableSingleByteCoverage) {
----------------
ornata wrote:

probably also needs to be wrapped in `#ifndef NDEBUG `

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


More information about the cfe-commits mailing list