[llvm] r207059 - Remove the intermediate AccelNamespace maps in DWARF units.
David Blaikie
dblaikie at gmail.com
Wed Apr 23 18:02:42 PDT 2014
Author: dblaikie
Date: Wed Apr 23 20:02:42 2014
New Revision: 207059
URL: http://llvm.org/viewvc/llvm-project?rev=207059&view=rev
Log:
Remove the intermediate AccelNamespace maps in DWARF units.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=207059&r1=207058&r2=207059&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Apr 23 20:02:42 2014
@@ -172,7 +172,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Mo
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
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);
+}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=207059&r1=207058&r2=207059&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Apr 23 20:02:42 2014
@@ -326,6 +326,7 @@ class DwarfDebug : public AsmPrinterHand
DwarfAccelTable AccelNames;
DwarfAccelTable AccelObjC;
+ DwarfAccelTable AccelNamespace;
MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
@@ -645,6 +646,8 @@ public:
void addAccelName(StringRef Name, const DIE *Die);
void addAccelObjC(StringRef Name, const DIE *Die);
+
+ void addAccelNamespace(StringRef Name, const DIE *Die);
};
} // End of namespace llvm
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=207059&r1=207058&r2=207059&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Wed Apr 23 20:02:42 2014
@@ -1065,14 +1065,6 @@ void DwarfUnit::addType(DIE *Entity, DIT
addDIEEntry(Entity, Attribute, Entry);
}
-void DwarfUnit::addAccelNamespace(StringRef Name, const DIE *Die) {
- if (!DD->useDwarfAccelTables())
- return;
- DU->getStringPoolEntry(Name);
- std::vector<const DIE *> &DIEs = AccelNamespace[Name];
- DIEs.push_back(Die);
-}
-
void DwarfUnit::addAccelType(StringRef Name,
std::pair<const DIE *, unsigned> Die) {
if (!DD->useDwarfAccelTables())
@@ -1415,10 +1407,10 @@ DIE *DwarfUnit::getOrCreateNameSpace(DIN
if (!NS.getName().empty()) {
addString(NDie, dwarf::DW_AT_name, NS.getName());
- addAccelNamespace(NS.getName(), NDie);
+ DD->addAccelNamespace(NS.getName(), NDie);
addGlobalName(NS.getName(), NDie, NS.getContext());
} else
- addAccelNamespace("(anonymous namespace)", NDie);
+ DD->addAccelNamespace("(anonymous namespace)", NDie);
addSourceLine(NDie, NS);
return NDie;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=207059&r1=207058&r2=207059&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Wed Apr 23 20:02:42 2014
@@ -102,9 +102,6 @@ protected:
/// GlobalTypes - A map of globally visible types for this unit.
StringMap<const DIE *> GlobalTypes;
- /// AccelNamespace - A map of names for the namespace accelerator table.
- StringMap<std::vector<const DIE *> > AccelNamespace;
-
/// AccelTypes - A map of names for the type accelerator table.
StringMap<std::vector<std::pair<const DIE *, unsigned> > > AccelTypes;
@@ -225,9 +222,6 @@ public:
const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
- const StringMap<std::vector<const DIE *> > &getAccelNamespace() const {
- return AccelNamespace;
- }
const StringMap<std::vector<std::pair<const DIE *, unsigned> > > &
getAccelTypes() const {
return AccelTypes;
More information about the llvm-commits
mailing list