summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-27 22:31:41 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-27 22:31:41 +0000
commit815a6eb55d8e4f27ee85a7b0ff44212b8150824b (patch)
tree077f3e9752a0133a67251f167773e2425ecc4776 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent3154aa23f31f2f78f251b70f7a9b3dfb54a596cc (diff)
downloadbcm5719-llvm-815a6eb55d8e4f27ee85a7b0ff44212b8150824b.tar.gz
bcm5719-llvm-815a6eb55d8e4f27ee85a7b0ff44212b8150824b.zip
AsmPrinter: Store abbreviation data directly in DIE and DIEValue
Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside the `DIEValue` list. Besides being a cleaner data structure (avoiding the parallel arrays), this gives us more freedom to rearrange the `DIEValue` list. This fixes the temporary memory regression from 845 MB up to 879 MB, and drops it further to 829 MB for a net memory decrease of around 1.9% (incremental decrease around 5.7%). (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 238364
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 2256200c8d0..b59fb002f72 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -51,8 +51,10 @@ void DwarfCompileUnit::addLocalLabelAddress(DIE &Die,
if (Label)
DD->addArangeLabel(SymbolCU(this, Label));
- Die.addValue(Attribute, dwarf::DW_FORM_addr,
- Label ? DIEValue(DIELabel(Label)) : DIEValue(DIEInteger(0)));
+ if (Label)
+ Die.addValue(Attribute, dwarf::DW_FORM_addr, DIELabel(Label));
+ else
+ Die.addValue(Attribute, dwarf::DW_FORM_addr, DIEInteger(0));
}
unsigned DwarfCompileUnit::getOrCreateSourceID(StringRef FileName,
@@ -253,9 +255,7 @@ void DwarfCompileUnit::initStmtList() {
}
void DwarfCompileUnit::applyStmtList(DIE &D) {
- D.addValue(dwarf::DW_AT_stmt_list,
- UnitDie.getAbbrev().getData()[stmtListIndex].getForm(),
- UnitDie.getValues()[stmtListIndex]);
+ D.addValue(UnitDie.getValues()[stmtListIndex]);
}
void DwarfCompileUnit::attachLowHighPC(DIE &D, const MCSymbol *Begin,
OpenPOWER on IntegriCloud