From 1e0d94e7bb989ac009467dd526e0d680bd02d4ee Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sun, 24 May 2015 16:48:54 +0000 Subject: AsmPrinter: Avoid EmitLabelDifference() in DwarfAccelTable Mint a new function, `AsmPrinter::emitDwarfStringOffset()`, which takes a `DwarfStringPoolEntryRef`. When DWARF is relocatable across sections, this defers to `emitSectionOffset()` and emits the `MCSymbol`; otherwise, just emit the offset directly, without using any intermediate symbols. `EmitLabelDifference()` is already optimized to emit absolute label differences cheaply when possible, so there aren't any major memory savings here (853 MB down to 851 MB, or 0.2%). However, it prepares for making the `MCSymbol`s in the `DwarfStringPool` optional. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 238119 --- llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp index ca953b982c2..58b406b788f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp @@ -216,7 +216,7 @@ void DwarfAccelTable::EmitData(AsmPrinter *Asm, DwarfDebug *D) { // Remember to emit the label for our offset. Asm->OutStreamer->EmitLabel((*HI)->Sym); Asm->OutStreamer->AddComment((*HI)->Str); - Asm->emitSectionOffset((*HI)->Data.Name.getSymbol()); + Asm->emitDwarfStringOffset((*HI)->Data.Name); Asm->OutStreamer->AddComment("Num DIEs"); Asm->EmitInt32((*HI)->Data.Values.size()); for (HashDataContents *HD : (*HI)->Data.Values) { -- cgit v1.2.3