[llvm] r204358 - Add comments from Eric's review of r204094.
David Blaikie
dblaikie at gmail.com
Thu Mar 20 10:05:45 PDT 2014
Author: dblaikie
Date: Thu Mar 20 12:05:45 2014
New Revision: 204358
URL: http://llvm.org/viewvc/llvm-project?rev=204358&view=rev
Log:
Add comments from Eric's review of r204094.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/test/DebugInfo/lto-comp-dir.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=204358&r1=204357&r2=204358&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Mar 20 12:05:45 2014
@@ -688,6 +688,11 @@ DwarfCompileUnit *DwarfDebug::constructD
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);
Modified: llvm/trunk/test/DebugInfo/lto-comp-dir.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/lto-comp-dir.ll?rev=204358&r1=204357&r2=204358&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/lto-comp-dir.ll (original)
+++ llvm/trunk/test/DebugInfo/lto-comp-dir.ll Thu Mar 20 12:05:45 2014
@@ -3,6 +3,10 @@
; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=line - | FileCheck %s
; RUN: %llc_dwarf < %s -filetype=asm | FileCheck --check-prefix=ASM %s
+; If multiple line tables are emitted, one per CU, those line tables can
+; unambiguously rely on the comp_dir of their owning CU and use directory '0'
+; to refer to it.
+
; CHECK: .debug_line contents:
; CHECK-NEXT: Line table prologue:
; CHECK-NOT: include_directories
@@ -14,6 +18,11 @@
; CHECK: file_names[ 1] 0 {{.*}} b.cpp
; CHECK-NOT: file_names
+; However, if a single line table is emitted and shared between CUs, the
+; comp_dir is ambiguous and relying on it would lead to different path
+; interpretations depending on which CU lead to the table - so ensure that
+; full paths are always emitted in this case, never comp_dir relative.
+
; ASM: .file 1 "/tmp/dbginfo/a{{[/\\]+}}a.cpp"
; ASM: .file 2 "/tmp/dbginfo/b{{[/\\]+}}b.cpp"
More information about the llvm-commits
mailing list