[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 22:52:40 PDT 2024


================
@@ -2050,23 +2069,74 @@ struct CounterCoverageMappingBuilder
                          subtractCounters(ParentCount, TrueCount));
   }
 
-  void createDecision(const BinaryOperator *E) {
+  void createOrCancelDecision(const BinaryOperator *E, unsigned Since) {
     unsigned NumConds = MCDCBuilder.getTotalConditionsAndReset(E);
     if (NumConds == 0)
       return;
 
+    // Extract [ID, Conds] to construct the graph.
+    llvm::SmallVector<mcdc::ConditionIDs> CondIDs(NumConds);
+    for (const auto &SR : ArrayRef(SourceRegions).slice(Since)) {
+      if (SR.isMCDCBranch()) {
----------------
chapuni wrote:

I think `make_filter_range` is less suitable here.

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


More information about the cfe-commits mailing list