summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-12-04 18:12:28 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-12-04 18:12:28 +0000
commit193140b0857b2b8b148647fd13a0fb75398417a5 (patch)
treeb0a0ab46042940afa28f3a4ae19180bf24cdbbfc /lib/CodeGen/AsmPrinter/DwarfUnit.cpp
parent6d3d93c40b3a08b6795fee56c8aaca2a2cde5bee (diff)
downloadllvm-193140b0857b2b8b148647fd13a0fb75398417a5.tar.gz
llvm-193140b0857b2b8b148647fd13a0fb75398417a5.tar.bz2
llvm-193140b0857b2b8b148647fd13a0fb75398417a5.tar.xz
DebugInfo: Remove unused start/end labels for the debug_abbrevs section
Since we always emit only one abbrevation section (shared by all the compilation units in this module) there's no need for a separate label at the start of each one (and we weren't using the CU ID anyway, so there really was only one label). Use the section label instead and drop the wholely unused debug_abbrev_end label. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index d65862040c..d3504f8a8f 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1980,8 +1980,10 @@ void Unit::emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym) {
Asm->OutStreamer.AddComment("DWARF version number");
Asm->EmitInt16(DD->getDwarfVersion());
Asm->OutStreamer.AddComment("Offset Into Abbrev. Section");
- Asm->EmitSectionOffset(Asm->GetTempSymbol(ASection->getLabelBeginName()),
- ASectionSym);
+ // We share one abbreviations table across all compilation units so it's
+ // always at the start of the section. Use a relocatable offset where needed
+ // to ensure linking doesn't invalidate that offset.
+ Asm->EmitSectionOffset(ASectionSym, ASectionSym);
Asm->OutStreamer.AddComment("Address Size (in bytes)");
Asm->EmitInt8(Asm->getDataLayout().getPointerSize());
}