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

Alan Phipps via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 19:10:44 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(); }
----------------
evodius96 wrote:

Ah, ok I think I misunderstood.  You're suggesting that the fact taht DecisionStack.back() returns byref needs to be reflected by the return type of this function. In other words, restore the return type to the way it was:

`const DecisionIDPair &back() const { return DecisionStack.back(); }`

I did change the visitBin* functions to no longer hold a reference. 

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


More information about the cfe-commits mailing list