Dwarf: do not use line_table_start in at_stmt_list since we do not always emit

line table entries in assembly.

llvm-svn: 174785
This commit is contained in:
Manman Ren 2013-02-09 00:41:44 +00:00
parent eba9e4a3aa
commit d2c95eb995
2 changed files with 5 additions and 2 deletions

View File

@ -670,9 +670,12 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
// DW_AT_stmt_list is a offset of line number information for this // DW_AT_stmt_list is a offset of line number information for this
// compile unit in debug_line section. // 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()) if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 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) else if (NewCU->getUniqueID() == 0)
NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0); NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
else else

View File

@ -3,7 +3,7 @@
; CHECK: .section .debug_line,"",@progbits ; CHECK: .section .debug_line,"",@progbits
; CHECK-NEXT: .Lsection_line: ; CHECK-NEXT: .Lsection_line:
; CHECK: .long .Lline_table_start0 # DW_AT_stmt_list ; CHECK: .long .Lsection_line # DW_AT_stmt_list
define void @f() { define void @f() {
entry: entry: