[llvm] r174785 - Dwarf: do not use line_table_start in at_stmt_list since we do not always emit

Manman Ren mren at apple.com
Fri Feb 8 16:41:44 PST 2013


Author: mren
Date: Fri Feb  8 18:41:44 2013
New Revision: 174785

URL: http://llvm.org/viewvc/llvm-project?rev=174785&view=rev
Log:
Dwarf: do not use line_table_start in at_stmt_list since we do not always emit 
line table entries in assembly.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/DebugInfo/X86/stmt-list.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=174785&r1=174784&r2=174785&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Feb  8 18:41:44 2013
@@ -670,9 +670,12 @@ CompileUnit *DwarfDebug::constructCompil
 
   // DW_AT_stmt_list is a offset of line number information for this
   // compile unit in debug_line section.
+  // The line table entries are not always emitted in assembly, so it
+  // is not okay to use line_table_start here.
   if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
     NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
-                    LineTableStartSym);
+                    NewCU->getUniqueID() == 0 ?
+                    Asm->GetTempSymbol("section_line") : LineTableStartSym);
   else if (NewCU->getUniqueID() == 0)
     NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
   else

Modified: llvm/trunk/test/DebugInfo/X86/stmt-list.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stmt-list.ll?rev=174785&r1=174784&r2=174785&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/stmt-list.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/stmt-list.ll Fri Feb  8 18:41:44 2013
@@ -3,7 +3,7 @@
 ; CHECK:      .section        .debug_line,"", at progbits
 ; CHECK-NEXT: .Lsection_line:
 
-; CHECK:      .long .Lline_table_start0 # DW_AT_stmt_list
+; CHECK:      .long   .Lsection_line          # DW_AT_stmt_list
 
 define void @f() {
 entry:





More information about the llvm-commits mailing list