[clang] [llvm] [clang][CoverageMapping] Refactor when setting MC/DC True/False (PR #78202)

Alan Phipps via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 18:13:49 PST 2024


================
@@ -663,54 +668,40 @@ struct MCDCCoverageBuilder {
 private:
   CodeGenModule &CGM;
 
-  llvm::SmallVector<MCDCConditionID> AndRHS;
-  llvm::SmallVector<MCDCConditionID> OrRHS;
-  llvm::SmallVector<const BinaryOperator *> NestLevel;
+  llvm::SmallVector<DecisionIDPair, 6> DecisionStack;
   llvm::DenseMap<const Stmt *, MCDCConditionID> &CondIDs;
   llvm::DenseMap<const Stmt *, unsigned> &MCDCBitmapMap;
   MCDCConditionID NextID = 1;
   bool NotMapped = false;
 
+  /// Represent a sentinel value of [0,0] for the bottom of DecisionStack.
+  static constexpr DecisionIDPair DecisionIDPairSentinel{0, 0};
----------------
evodius96 wrote:

Sure, I can use that name.

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


More information about the llvm-commits mailing list