aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index f4f6fce457..f32dea9ebf 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1837,9 +1837,11 @@ void DwarfDebug::beginModule(Module *M, MachineModuleInfo *mmi) {
constructGlobalVariableDIE(*I);
else if (GVContext.isNameSpace()) {
DIE *GVDie = createGlobalVariableDIE(ModuleCU, GV);
- DINameSpace NS(GVContext.getNode());
- DIE *NDie = getOrCreateNameSpace(NS);
- NDie->addChild(GVDie);
+ if (GVDie) {
+ DINameSpace NS(GVContext.getNode());
+ DIE *NDie = getOrCreateNameSpace(NS);
+ NDie->addChild(GVDie);
+ }
}
else
ScopedGVs.push_back(*I);