aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-12-10 23:25:41 +0000
committerDevang Patel <dpatel@apple.com>2009-12-10 23:25:41 +0000
commitedb4563ceae52e67f0b5cb2f084e3e8da6eba7d3 (patch)
treef9613c23701c5dec6b2421d95dfbbaa5844b0a12 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent072f6fe196a1b6b9289a44a201b759fa72625b44 (diff)
If VariableDIe is not created (may be because global was optimzed away) then do not try to use the variable die.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index c7b3cfed87..1cd28db119 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1632,6 +1632,8 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
return;
DIE *VariableDie = createGlobalVariableDIE(DI_GV);
+ if (!VariableDie)
+ return;
// Add to map.
ModuleCU->insertDIE(N, VariableDie);