================
@@ -222,6 +222,12 @@ OriginList *OriginManager::getOrCreateList(const Expr *E) {
   if (const ExprWithCleanups *EWC = dyn_cast<ExprWithCleanups>(E))
     return getOrCreateList(EWC->getSubExpr());
 
+  // An OpaqueValueExpr is a placeholder for an already-evaluated subexpression
+  // (e.g. the common operand of `a ?: b`); reuse its source's origins.
+  if (const auto *OVE = dyn_cast<OpaqueValueExpr>(E))
+    if (const Expr *Src = OVE->getSourceExpr())
+      return getOrCreateList(Src);
----------------
Xazax-hun wrote:

Oh my bad, now I remember why is it here. Just like with the `ExprWithCleanups` 
above, this does not show up in the CFG as an individual element. I could add a 
special case when we handle the binary conditional expression but I think it is 
more universal here (it also is impactful when this shows up at a different 
place).

https://github.com/llvm/llvm-project/pull/204439
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to