[PATCH] D140724: [clang][Interp] Add back Run() call

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 13 08:11:31 PST 2023


shafik accepted this revision.
shafik added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/lib/AST/Interp/Interp.h:1301
   assert(S.Current->getFunction()->hasRVO());
+  if (S.checkingPotentialConstantExpression())
+    return false;
----------------
tbaeder wrote:
> shafik wrote:
> > Why did you add these checks calling `checkingPotentialConstantExpression` for?
> The RVO pointer needs to be on the stack when calling a function (much like the `this` pointer). In the context of the `Run` call after compiling a function, it cannot exist and so we can't return anything here. This is similar to the pre-existing check in `This()` just above this function.
Ahhh that makes sense. Can you add some comments, not sure where the right place is b/c this feels very opaque and I am not sure how I would figure this out otherwise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140724/new/

https://reviews.llvm.org/D140724



More information about the cfe-commits mailing list