[clang] [clang][DebugInfo] Attach DW_AT_const_value to static data-member definitions if available (PR #72730)

Paul T Robinson via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 08:08:26 PST 2023


================
@@ -69,6 +69,29 @@ static uint32_t getDeclAlignIfRequired(const Decl *D, const ASTContext &Ctx) {
   return D->hasAttr<AlignedAttr>() ? D->getMaxAlignment() : 0;
 }
 
+/// Given a VarDecl corresponding to either the definition or
+/// declaration of a C++ static data member, if it has a constant
+/// initializer and is evaluatable, return the evaluated value.
+/// Returns std::nullopt on failure.
----------------
pogo59 wrote:

Maybe instead of "on failure" say "otherwise." It's not really a _failure_ condition.

https://github.com/llvm/llvm-project/pull/72730


More information about the cfe-commits mailing list