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

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 18:56:36 PST 2024


================
@@ -722,6 +713,9 @@ struct MCDCCoverageBuilder {
       return I->second;
   }
 
+  /// Return the LHS Decision ([0,0] if not set).
+  const DecisionIDPair back() const { return DecisionStack.back(); }
----------------
chapuni wrote:

This may return byref since `DecisionStack.back()` returns byref. I think this is consistent.
The callee (visitBin) may take an option to copy values instead of holding the ref.

I guess the change doesn't have any big impacts for generated code. I suggest just for the consistency.

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


More information about the cfe-commits mailing list