If VariableDIe is not created (may be because global was optimzed away) then do not...
authorDevang Patel <dpatel@apple.com>
Thu, 10 Dec 2009 23:25:41 +0000 (23:25 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 10 Dec 2009 23:25:41 +0000 (23:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91077 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index c7b3cfed87184125958cf3057ebf773fe668d45d..1cd28db11946014f3ab85bacb6a29ff915400047 100644 (file)
@@ -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);