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

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 10 08:08:28 PST 2023


================
@@ -5596,6 +5587,42 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
       TemplateParameters, Align));
 }
 
+void CGDebugInfo::EmitGlobalVariable(const VarDecl *VD) {
+  assert(VD->hasInit());
+  assert(CGM.getCodeGenOpts().hasReducedDebugInfo());
+  if (VD->hasAttr<NoDebugAttr>())
+    return;
+
+  auto &GV = DeclCache[VD];
----------------
adrian-prantl wrote:

is it intentional that we cache nullptr here if the next condition fails?

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


More information about the cfe-commits mailing list