aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-11-06 17:58:12 +0000
committerDevang Patel <dpatel@apple.com>2009-11-06 17:58:12 +0000
commit83e42c7163cc29cf8afd36082164ffb8a2e4b454 (patch)
treeb1d049744293905389d9485b36cc83844deec266 /lib
parentde46a5b60ea8cf3db0b613172667a7038470c578 (diff)
downloadexternal_llvm-83e42c7163cc29cf8afd36082164ffb8a2e4b454.zip
external_llvm-83e42c7163cc29cf8afd36082164ffb8a2e4b454.tar.gz
external_llvm-83e42c7163cc29cf8afd36082164ffb8a2e4b454.tar.bz2
Do not bother to emit debug info for nameless global variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/DebugInfo.cpp3
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index b64dbf4..7c1cc35 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -366,6 +366,9 @@ bool DIGlobalVariable::Verify() const {
if (isNull())
return false;
+ if (!getDisplayName())
+ return false;
+
if (getContext().isNull())
return false;
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 6b54e61..de8cfc6 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1098,8 +1098,8 @@ DIE *DwarfDebug::ConstructEnumTypeDIE(CompileUnit *DW_Unit, DIEnumerator *ETy) {
DIE *DwarfDebug::CreateGlobalVariableDIE(CompileUnit *DW_Unit,
const DIGlobalVariable &GV) {
// If the global variable was optmized out then no need to create debug info entry.
- if (!GV.getGlobal())
- return NULL;
+ if (!GV.getGlobal()) return NULL;
+ if (!GV.getDisplayName()) return NULL;
DIE *GVDie = new DIE(dwarf::DW_TAG_variable);
AddString(GVDie, dwarf::DW_AT_name, dwarf::DW_FORM_string,