Don't return error_code from a function that doesn't fail.
[oota-llvm.git] / lib / DebugInfo / DWARF / DWARFTypeUnit.cpp
index 65c7bff0990de70e7050671e6665988430e1e83e..766e8ac16f0ccdfb41b639cd457dd09acf2c3fb4 100644 (file)
@@ -33,7 +33,8 @@ void DWARFTypeUnit::dump(raw_ostream &OS) {
      << " (next unit at " << format("0x%08x", getNextUnitOffset())
      << ")\n";
 
-  const DWARFDebugInfoEntryMinimal *CU = getCompileUnitDIE(false);
-  assert(CU && "Null Compile Unit?");
-  CU->dump(OS, this, -1U);
+  if (const DWARFDebugInfoEntryMinimal *TU = getUnitDIE(false))
+    TU->dump(OS, this, -1U);
+  else
+    OS << "<type unit can't be parsed!>\n\n";
 }