Add comments from Eric's review of r204094.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index 6925cb6bdde88e4e7e230bd3d46271822b01d90f..e8055d7cf7ca5990d55b3ced928a9bd7dea2bc68 100644 (file)
@@ -688,6 +688,11 @@ DwarfCompileUnit *DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
   DwarfCompileUnit *NewCU = new DwarfCompileUnit(
       InfoHolder.getUnits().size(), Die, DIUnit, Asm, this, &InfoHolder);
   InfoHolder.addUnit(NewCU);
+
+  // LTO with assembly output shares a single line table amongst multiple CUs.
+  // To avoid the compilation directory being ambiguous, let the line table
+  // explicitly describe the directory of all files, never relying on the
+  // compilation directory.
   if (!Asm->OutStreamer.hasRawTextSupport() || SingleCU)
     Asm->OutStreamer.getContext().setMCLineTableCompilationDir(
         NewCU->getUniqueID(), CompilationDir);