DebugInfo: Assume all subprogram DIEs have been created before any abstract subprogra...
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index f584c2a036fd49e08e8c58f6e8878af04f987e2c..c649aa134524be4bea1d1cab187e04a54cc0db35 100644 (file)
@@ -552,11 +552,11 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
   if (!ProcessedSPNodes.insert(Sub))
     return;
 
-  if (DIE *ScopeDIE = TheCU.getDIE(Sub)) {
-    AbstractSPDies.insert(std::make_pair(Sub, ScopeDIE));
-    TheCU.addUInt(*ScopeDIE, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
-    createAndAddScopeChildren(TheCU, Scope, *ScopeDIE);
-  }
+  DIE *ScopeDIE = TheCU.getDIE(Sub);
+  assert(ScopeDIE);
+  AbstractSPDies.insert(std::make_pair(Sub, ScopeDIE));
+  TheCU.addUInt(*ScopeDIE, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
+  createAndAddScopeChildren(TheCU, Scope, *ScopeDIE);
 }
 
 DIE &DwarfDebug::constructSubprogramScopeDIE(DwarfCompileUnit &TheCU,