[PATCH] D151587: [clang][ConstantEmitter] have tryEmitPrivate[ForVarInit] try ConstExprEmitter fast-path first

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 20 11:40:46 PDT 2023


efriedma added inline comments.


================
Comment at: clang/lib/AST/Expr.cpp:3462-3468
       ->isConstantInitializer(Ctx, false, Culprit);
   case CXXDefaultArgExprClass:
     return cast<CXXDefaultArgExpr>(this)->getExpr()
       ->isConstantInitializer(Ctx, false, Culprit);
   case CXXDefaultInitExprClass:
     return cast<CXXDefaultInitExpr>(this)->getExpr()
       ->isConstantInitializer(Ctx, false, Culprit);
----------------
nickdesaulniers wrote:
> @efriedma should a few more of these cases be changed from passing `false` as the `ForRef` param of `isConstantInitializer` to `IsForRef`?  If I change the rest of the cases except for `MaterializeTemporaryExprClass` then tests are still green.
One of the reasons I didn't go with this approach is that I really didn't want to think about this question...

We probably don't have good test coverage for the C++ constructs, since we don't really use isConstantInitializer() outside of C++03 mode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151587



More information about the cfe-commits mailing list