summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-24 01:02:42 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-24 01:02:42 +0000
commitecf0415245e7033fffad2fe251b839cc01d71133 (patch)
tree6c2210fa790bef1e32b1c372df2628f44e261280 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parentdee4b2c379ab6913f03001c94d3f3753a1e09ad6 (diff)
downloadbcm5719-llvm-ecf0415245e7033fffad2fe251b839cc01d71133.tar.gz
bcm5719-llvm-ecf0415245e7033fffad2fe251b839cc01d71133.zip
Remove the intermediate AccelNamespace maps in DWARF units.
llvm-svn: 207059
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 549e991829e..5490721bc05 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -172,7 +172,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
AccelNames(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
dwarf::DW_FORM_data4)),
AccelObjC(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
- dwarf::DW_FORM_data4)) {
+ dwarf::DW_FORM_data4)),
+ AccelNamespace(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,
+ dwarf::DW_FORM_data4)) {
DwarfInfoSectionSym = DwarfAbbrevSectionSym = DwarfStrSectionSym = 0;
DwarfDebugRangeSectionSym = DwarfDebugLocSectionSym = DwarfLineSectionSym = 0;
@@ -1885,24 +1887,14 @@ void DwarfDebug::emitAccelObjC() {
// Emit namespace dies into a hashed accelerator table.
void DwarfDebug::emitAccelNamespaces() {
- DwarfAccelTable AT(
- DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4));
- for (const auto &TheU : getUnits()) {
- for (const auto &GI : TheU->getAccelNamespace()) {
- StringRef Name = GI.getKey();
- for (const DIE *D : GI.second)
- AT.AddName(Name, D);
- }
- }
-
- AT.FinalizeTable(Asm, "namespac");
+ AccelNamespace.FinalizeTable(Asm, "namespac");
Asm->OutStreamer.SwitchSection(
Asm->getObjFileLowering().getDwarfAccelNamespaceSection());
MCSymbol *SectionBegin = Asm->GetTempSymbol("namespac_begin");
Asm->OutStreamer.EmitLabel(SectionBegin);
// Emit the full data.
- AT.Emit(Asm, SectionBegin, &InfoHolder);
+ AccelNamespace.Emit(Asm, SectionBegin, &InfoHolder);
}
// Emit type dies into a hashed accelerator table.
@@ -2568,3 +2560,10 @@ void DwarfDebug::addAccelObjC(StringRef Name, const DIE *Die) {
InfoHolder.getStringPoolEntry(Name);
AccelObjC.AddName(Name, Die);
}
+
+void DwarfDebug::addAccelNamespace(StringRef Name, const DIE *Die) {
+ if (!useDwarfAccelTables())
+ return;
+ InfoHolder.getStringPoolEntry(Name);
+ AccelNamespace.AddName(Name, Die);
+}
OpenPOWER on IntegriCloud