AsmPrinter: Emit the DwarfStringPool offset directly when possible
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 24 May 2015 16:14:59 +0000 (16:14 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 24 May 2015 16:14:59 +0000 (16:14 +0000)
commit1a65e4ade4e77ad56a57502dcb0cb21b2850df7a
treebf8347914756152c8d7abb2f14be13e0b89173ee
parent004e73420d1d8ffdc75ff7d9c88911f33c6c6278
AsmPrinter: Emit the DwarfStringPool offset directly when possible

Change `DwarfStringPool` to calculate byte offsets on-the-fly, and
update `DwarfUnit::getLocalString()` to use a `DIEInteger` instead of a
`DIEDelta` when Dwarf doesn't use relocations (i.e., Mach-O).  This
eliminates another call to `EmitLabelDifference()`, and drops memory
usage from 865 MB down to 861 MB, around 0.5%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238114
llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
llvm/test/DebugInfo/X86/stringpool.ll