[llvm] [MC/DC] Introduce `class TestVector` with a pair of `BitVector` (PR #82174)

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 00:31:06 PST 2024


================
@@ -380,7 +380,70 @@ struct MCDCRecord {
   /// are effectively ignored.
   enum CondState { MCDC_DontCare = -1, MCDC_False = 0, MCDC_True = 1 };
 
-  using TestVector = llvm::SmallVector<CondState>;
+  /// Emulate SmallVector<CondState> with a pair of BitVector.
+  ///
+  ///          True  False DontCare (Impossible)
+  /// Values:  True  False False    True
+  /// Visited: True  True  False    False
+  class TestVector {
+    BitVector Values;  /// True/False (False when DontCare)
+    BitVector Visited; /// ~DontCare
+
+  public:
+    /// Assume filling DontCare.
----------------
chapuni wrote:

It's because the only user (`TV` in `findExecutedTestVectors()`) specifies `DontCare` explicitly. I wanted to leave it since I thought it was more descriptive.

I can prune the initial value in this.

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


More information about the llvm-commits mailing list