Rework adding function names to the dwarf accelerator tables, allow
multiple dies per function and support C++ basenames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144304 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 1cbe3a0..453e898 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -62,7 +62,7 @@
/// AccelNames - A map of names for the name accelerator table.
///
- StringMap<DIE*> AccelNames;
+ StringMap<std::vector<DIE*> > AccelNames;
StringMap<std::vector<DIE*> > AccelObjC;
StringMap<DIE*> AccelNamespace;
StringMap<DIE*> AccelTypes;
@@ -84,7 +84,9 @@
DIE* getCUDie() const { return CUDie.get(); }
const StringMap<DIE*> &getGlobalTypes() const { return GlobalTypes; }
- const StringMap<DIE*> &getAccelNames() const { return AccelNames; }
+ const StringMap<std::vector<DIE*> > &getAccelNames() const {
+ return AccelNames;
+ }
const StringMap<std::vector<DIE*> > &getAccelObjC() const {
return AccelObjC;
}
@@ -101,7 +103,10 @@
/// addAccelName - Add a new name to the name accelerator table.
- void addAccelName(StringRef Name, DIE *Die) { AccelNames[Name] = Die; }
+ void addAccelName(StringRef Name, DIE *Die) {
+ std::vector<DIE*> &DIEs = AccelNames[Name];
+ DIEs.push_back(Die);
+ }
void addAccelObjC(StringRef Name, DIE *Die) {
std::vector<DIE*> &DIEs = AccelObjC[Name];
DIEs.push_back(Die);