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)
commite3ae958f94f6ceaaad9fed107316fbcc022a8628
tree3d4ccbbe7b1e87fd5bd4a338b070173264ed84a1
parent237137532ad4c0c160d29be4cf4835712603ad69
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.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238114 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
lib/CodeGen/AsmPrinter/DwarfStringPool.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
test/DebugInfo/X86/stringpool.ll