[PR18809] Revert r201187, "DebugInfo: Don't include the name of the CU file in the...
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index 92c153bf64e7a37a544ad2faeb7abda3e9dacf50..d50f9d6c7d0a77f0d88b07baad7b8ff9d1d4d3c0 100644 (file)
@@ -751,6 +751,9 @@ DwarfCompileUnit *DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
   InfoHolder.addUnit(NewCU);
 
   FileIDCUMap[NewCU->getUniqueID()] = 0;
+  // Call this to emit a .file directive if it wasn't emitted for the source
+  // file this CU comes from yet.
+  getOrCreateSourceID(FN, CompilationDir, NewCU->getUniqueID());
 
   NewCU->addString(Die, dwarf::DW_AT_producer, DIUnit.getProducer());
   NewCU->addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,