diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 453e8985792..07a772338ee 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -64,8 +64,8 @@ class CompileUnit { /// StringMap > AccelNames; StringMap > AccelObjC; - StringMap AccelNamespace; - StringMap AccelTypes; + StringMap > AccelNamespace; + StringMap > AccelTypes; /// DIEBlocks - A list of all the DIEBlocks in use. std::vector DIEBlocks; @@ -90,8 +90,12 @@ public: const StringMap > &getAccelObjC() const { return AccelObjC; } - const StringMap &getAccelNamespace() const { return AccelNamespace; } - const StringMap &getAccelTypes() const { return AccelTypes; } + const StringMap > &getAccelNamespace() const { + return AccelNamespace; + } + const StringMap > &getAccelTypes() const { + return AccelTypes; + } /// hasContent - Return true if this compile unit has something to write out. /// @@ -112,10 +116,12 @@ public: DIEs.push_back(Die); } void addAccelNamespace(StringRef Name, DIE *Die) { - AccelNamespace[Name] = Die; + std::vector &DIEs = AccelNamespace[Name]; + DIEs.push_back(Die); } void addAccelType(StringRef Name, DIE *Die) { - AccelTypes[Name] = Die; + std::vector &DIEs = AccelTypes[Name]; + DIEs.push_back(Die); } /// getDIE - Returns the debug information entry map slot for the diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 3ca23183a29..5d05a3cc3aa 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1823,12 +1823,14 @@ void DwarfDebug::emitAccelNamespaces() { for (DenseMap::iterator I = CUMap.begin(), E = CUMap.end(); I != E; ++I) { CompileUnit *TheCU = I->second; - const StringMap &Names = TheCU->getAccelNamespace(); - for (StringMap::const_iterator + const StringMap > &Names = TheCU->getAccelNamespace(); + for (StringMap >::const_iterator GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { const char *Name = GI->getKeyData(); - DIE *Entity = GI->second; - AT.AddName(Name, Entity); + std::vector Entities = GI->second; + for (std::vector::const_iterator DI = Entities.begin(), + DE = Entities.end(); DI != DE; ++DI) + AT.AddName(Name, (*DI)); } } @@ -1849,12 +1851,14 @@ void DwarfDebug::emitAccelTypes() { for (DenseMap::iterator I = CUMap.begin(), E = CUMap.end(); I != E; ++I) { CompileUnit *TheCU = I->second; - const StringMap &Names = TheCU->getAccelTypes(); - for (StringMap::const_iterator + const StringMap > &Names = TheCU->getAccelTypes(); + for (StringMap >::const_iterator GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { const char *Name = GI->getKeyData(); - DIE *Entity = GI->second; - AT.AddName(Name, Entity); + std::vector Entities = GI->second; + for (std::vector::const_iterator DI = Entities.begin(), + DE= Entities.end(); DI !=DE; ++DI) + AT.AddName(Name, (*DI)); } }