[lldb] [clang] Reland "[clang][DebugInfo] Emit global variable definitions for static data members with constant initializers" (PR #71780)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 10 08:43:58 PST 2023


================
@@ -5800,6 +5827,18 @@ void CGDebugInfo::setDwoId(uint64_t Signature) {
 }
 
 void CGDebugInfo::finalize() {
+  for (auto const *VD : StaticDataMemberDefinitionsToEmit) {
+    assert(VD->isStaticDataMember());
+
+    if (DeclCache.contains(VD))
+      continue;
+
+    if (!VD->hasInit())
----------------
Michael137 wrote:

I'll update the `EmitGlobalVariable` docs to clarify that we need an initialiser, otherwise behaviour is undefined

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


More information about the cfe-commits mailing list