[PATCH] DebugInfo: hoist definition into global context when needed

Frederic Riss friss at apple.com
Tue Feb 24 15:37:47 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/CGDebugInfo.cpp:2379-2382
@@ -2378,4 +2378,6 @@
   // we have support for emitting declarations of (non-member) global variables.
-  VDContext = getContextDescriptor(
-      dyn_cast<Decl>(VD->isStaticDataMember() ? VD->getLexicalDeclContext()
-                                              : VD->getDeclContext()));
+  const DeclContext *DC = VD->isStaticDataMember() ? VD->getLexicalDeclContext()
+                                                   : VD->getDeclContext();
+  while (DC->isRecord())
+    DC = DC->getParent();
+  VDContext = getContextDescriptor(dyn_cast<Decl>(DC));
----------------
The message makes it look like this change addresses a very particular case related to dllexport, yet the logic makes no mention of it. Care to elaborate why this doesn't change anything is other cases?

http://reviews.llvm.org/D7872

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list