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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 21 10:28:42 PDT 2023


nickdesaulniers added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:8384-8385
     const MaterializeTemporaryExpr *E) {
+  if (Info.EvalMode == EvalInfo::EM_ConstantFold)
+    return false;
+
----------------
nickdesaulniers wrote:
> removing these two lines fixes the following regressions:
> 
> Failed Tests (6):
>   llvm-libc++-shared.cfg.in :: std/algorithms/alg.modifying.operations/alg.fill/ranges.fill.pass.cpp
>   llvm-libc++-shared.cfg.in :: std/algorithms/alg.modifying.operations/alg.fill/ranges.fill_n.pass.cpp
>   llvm-libc++-shared.cfg.in :: std/strings/basic.string/string.cons/dtor.pass.cpp
>   llvm-libc++-shared.cfg.in :: std/strings/basic.string/string.cons/pointer_assignment.pass.cpp
>   llvm-libc++-shared.cfg.in :: std/strings/basic.string/string.modifiers/string_assign/pointer.pass.cpp
>   llvm-libc++-shared.cfg.in :: std/utilities/utility/pairs/pairs.pair/assign.pair_like_rv.pass.cpp
> 
> The condition probably needs further specification. Let me see if I can work out what's missing.
Might need to restore the `E->getStorageDuration() == SD_Static && ` check.


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