PR20038: DebugInfo missing DIEs for some concrete variables.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index 2269686d2e2ff82c5b71bd18b26a2bb126f0839c..a88aebd2d22f248a1dca51a165fb8e9d70600cbd 100644 (file)
@@ -786,6 +786,9 @@ void DwarfDebug::beginModule() {
 void DwarfDebug::finishVariableDefinitions() {
   for (const auto &Var : ConcreteVariables) {
     DIE *VariableDie = Var->getDIE();
+    // FIXME: There shouldn't be any variables without DIEs.
+    if (!VariableDie)
+      continue;
     // FIXME: Consider the time-space tradeoff of just storing the unit pointer
     // in the ConcreteVariables list, rather than looking it up again here.
     // DIE::getUnit isn't simple - it walks parent pointers, etc.