[PATCH] D145369: Emit const globals with constexpr destructor as constant LLVM values

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 11:54:47 PDT 2023


efriedma added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4344
+             (Record->hasTrivialDestructor() ||
+              Record->hasConstexprDestructor());
   }
----------------
For the purposes of CodeGen, checking `Record->hasConstexprDestructor()` isn't really helpful.  Even if `Record->hasConstexprDestructor()` is true, a destructor can still have side-effects.  Since the callers need to handle that possibility anyway, you might as well just skip the `Record->hasTrivialDestructor() || Record->hasConstexprDestructor()` check.


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

https://reviews.llvm.org/D145369



More information about the cfe-commits mailing list