From 3464161070a8606f261b0fd2377ed02f6f7187a5 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 1 Apr 2014 08:07:52 +0000 Subject: DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference This moves one case of raw text checking down into the MCStreamer interfaces in the form of a virtual function, even if we ultimately end up consolidating on the one-or-many line tables issue one day, this is nicer in the interim. This just generally streamlines a bunch of use cases into a common code path. llvm-svn: 205287 --- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index eaf0a17f052..dc3917b5857 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -2070,13 +2070,7 @@ void DwarfUnit::addRange(RangeSpan Range) { void DwarfCompileUnit::initStmtList(MCSymbol *DwarfLineSectionSym) { // Define start line table label for each Compile Unit. MCSymbol *LineTableStartSym = - Asm->GetTempSymbol("line_table_start", getUniqueID()); - Asm->OutStreamer.getContext().setMCLineTableSymbol(LineTableStartSym, - getUniqueID()); - - // Use a single line table if we are generating assembly. - bool UseTheFirstCU = - Asm->OutStreamer.hasRawTextSupport() || (getUniqueID() == 0); + Asm->OutStreamer.getDwarfLineTableSymbol(getUniqueID()); stmtListIndex = UnitDie->getValues().size(); @@ -2086,10 +2080,7 @@ void DwarfCompileUnit::initStmtList(MCSymbol *DwarfLineSectionSym) { // 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()) - addSectionLabel(UnitDie.get(), dwarf::DW_AT_stmt_list, - UseTheFirstCU ? DwarfLineSectionSym : LineTableStartSym); - else if (UseTheFirstCU) - addSectionOffset(UnitDie.get(), dwarf::DW_AT_stmt_list, 0); + addSectionLabel(UnitDie.get(), dwarf::DW_AT_stmt_list, LineTableStartSym); else addSectionDelta(UnitDie.get(), dwarf::DW_AT_stmt_list, LineTableStartSym, DwarfLineSectionSym); -- cgit v1.2.3