[llvm-commits] [dragonegg] r97394 - /dragonegg/trunk/llvm-debug.cpp

Duncan Sands baldrick at free.fr
Sun Feb 28 05:26:02 PST 2010


Author: baldrick
Date: Sun Feb 28 07:26:02 2010
New Revision: 97394

URL: http://llvm.org/viewvc/llvm-project?rev=97394&view=rev
Log:
Port commit 95567 (dpatel) from llvm-gcc:
Do not emit linkage name for function local statics. 
Emit linkage name otherwise.

Modified:
    dragonegg/trunk/llvm-debug.cpp

Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=97394&r1=97393&r2=97394&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sun Feb 28 07:26:02 2010
@@ -460,9 +460,13 @@
     if (IDENTIFIER_POINTER(DECL_NAME(decl)))
       DispName = IDENTIFIER_POINTER(DECL_NAME(decl));
   }
-    
+  StringRef LinkageName;
+  // The gdb does not expect linkage names for function local statics.
+  if (DECL_CONTEXT (decl))
+    if (TREE_CODE (DECL_CONTEXT (decl)) != FUNCTION_DECL)
+      LinkageName = GV->getName();
   DebugFactory.CreateGlobalVariable(findRegion(DECL_CONTEXT(decl)),
-                                    DispName, DispName, StringRef(),
+                                    DispName, DispName, LinkageName,
                                     getOrCreateCompileUnit(Loc.file), Loc.line,
                                     TyD, GV->hasInternalLinkage(),
                                     true/*definition*/, GV);





More information about the llvm-commits mailing list