AsmPrinter: Avoid creating symbols in DwarfStringPool

Stop creating symbols we don't need in `DwarfStringPool`.  The consumers
only call `DwarfStringPoolEntryRef::getSymbol()` when DWARF is
relocatable, so this just stops creating the unused symbols when it's
not.  This drops memory usage from 851 MB to 845 MB, around 0.7%.

(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@238122 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-05-24 16:58:59 +00:00
parent b976cabda3
commit 518dcb905e
3 changed files with 18 additions and 5 deletions

View File

@ -34,7 +34,10 @@ public:
: I(&I) {}
explicit operator bool() const { return I; }
MCSymbol *getSymbol() const { return I->second.Symbol; }
MCSymbol *getSymbol() const {
assert(I->second.Symbol && "No symbol available!");
return I->second.Symbol;
}
unsigned getOffset() const { return I->second.Offset; }
unsigned getIndex() const { return I->second.Index; }
StringRef getString() const { return I->first(); }