]> granicus.if.org Git - clang/commitdiff
Encode global variable name in debug info.
authorDevang Patel <dpatel@apple.com>
Tue, 20 Oct 2009 18:26:30 +0000 (18:26 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 20 Oct 2009 18:26:30 +0000 (18:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84653 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGen/2009-10-20-GlobalDebug.c [new file with mode: 0644]

index 0e7318c6b7703c29c2c346943fc680d0f064e7ed..9bd9444703e7e8e184851dd4e81b790c20d382f0 100644 (file)
@@ -1364,7 +1364,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
   }
 
   DebugFactory.CreateGlobalVariable(getContext(Decl, Unit), 
-                                    Name, Name, "", Unit, LineNo,
+                                    Name, Name, Name, Unit, LineNo,
                                     getOrCreateType(T, Unit),
                                     Var->hasInternalLinkage(),
                                     true/*definition*/, Var);
@@ -1394,7 +1394,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
                                            ArrayType::Normal, 0);
   }
 
-  DebugFactory.CreateGlobalVariable(Unit, Name, Name, "", Unit, LineNo,
+  DebugFactory.CreateGlobalVariable(Unit, Name, Name, Name, Unit, LineNo,
                                     getOrCreateType(T, Unit),
                                     Var->hasInternalLinkage(),
                                     true/*definition*/, Var);
diff --git a/test/CodeGen/2009-10-20-GlobalDebug.c b/test/CodeGen/2009-10-20-GlobalDebug.c
new file mode 100644 (file)
index 0000000..33d89f1
--- /dev/null
@@ -0,0 +1,4 @@
+// RUN: clang -S -g -dA %s -o - | FileCheck %s
+int global;
+// CHECK: asciz  "global"                                    ## DW_AT_MIPS_linkage_name
+int main() { return 0;}