diff options
author | Eric Christopher <echristo@gmail.com> | 2013-01-08 22:22:06 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-01-08 22:22:06 +0000 |
commit | 27614589dc6d214d7a69a1ad8dc3db3803b2b53e (patch) | |
tree | 5c4189b738b692d22f7e412119213f4ccb797566 /llvm/lib | |
parent | c2c423eac245b1de21758c306365a0b7ff72e687 (diff) | |
download | bcm5719-llvm-27614589dc6d214d7a69a1ad8dc3db3803b2b53e.tar.gz bcm5719-llvm-27614589dc6d214d7a69a1ad8dc3db3803b2b53e.zip |
Move the string pools down into the units. No functional change.
llvm-svn: 171905
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 19 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 17 |
2 files changed, 14 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 5c8ef241492..66a5a6db4cf 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -155,15 +155,14 @@ DIType DbgVariable::getType() const { DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) : Asm(A), MMI(Asm->MMI), FirstCU(0), AbbreviationsSet(InitAbbreviationsSetSize), - SourceIdMap(DIEValueAllocator), InfoStringPool(DIEValueAllocator), + SourceIdMap(DIEValueAllocator), PrevLabel(NULL), GlobalCUIndexCount(0), - InfoHolder(A, &AbbreviationsSet, &Abbreviations, - &InfoStringPool, "info_string"), + InfoHolder(A, &AbbreviationsSet, &Abbreviations, "info_string", + DIEValueAllocator), SkeletonCU(0), SkeletonAbbrevSet(InitAbbreviationsSetSize), - SkeletonStringPool(DIEValueAllocator), - SkeletonHolder(A, &SkeletonAbbrevSet, &SkeletonAbbrevs, - &SkeletonStringPool, "skel_string") { + SkeletonHolder(A, &SkeletonAbbrevSet, &SkeletonAbbrevs, "skel_string", + DIEValueAllocator) { DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0; DwarfStrSectionSym = TextSectionSym = 0; @@ -221,7 +220,7 @@ MCSymbol *DwarfUnits::getStringPoolSym() { MCSymbol *DwarfUnits::getStringPoolEntry(StringRef Str) { std::pair<MCSymbol*, unsigned> &Entry = - StringPool->GetOrCreateValue(Str).getValue(); + StringPool.GetOrCreateValue(Str).getValue(); if (Entry.first) return Entry.first; Entry.second = NextStringPoolNumber++; @@ -230,7 +229,7 @@ MCSymbol *DwarfUnits::getStringPoolEntry(StringRef Str) { unsigned DwarfUnits::getStringPoolIndex(StringRef Str) { std::pair<MCSymbol*, unsigned> &Entry = - StringPool->GetOrCreateValue(Str).getValue(); + StringPool.GetOrCreateValue(Str).getValue(); if (Entry.first) return Entry.second; Entry.second = NextStringPoolNumber++; @@ -2130,7 +2129,7 @@ void DwarfUnits::emitStrings(const MCSection *StrSection, const MCSection *OffsetSection = NULL, const MCSymbol *StrSecSym = NULL) { - if (StringPool->empty()) return; + if (StringPool.empty()) return; // Start the dwarf str section. Asm->OutStreamer.SwitchSection(StrSection); @@ -2141,7 +2140,7 @@ void DwarfUnits::emitStrings(const MCSection *StrSection, StringMapEntry<std::pair<MCSymbol*, unsigned> >*>, 64> Entries; for (StringMap<std::pair<MCSymbol*, unsigned> >::iterator - I = StringPool->begin(), E = StringPool->end(); + I = StringPool.begin(), E = StringPool.end(); I != E; ++I) Entries.push_back(std::make_pair(I->second.second, &*I)); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index cc6c0f7e638..1e471f75f51 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -211,16 +211,16 @@ class DwarfUnits { SmallVector<CompileUnit *, 1> CUs; // Collection of strings for this unit and assorted symbols. - StrPool *StringPool; + StrPool StringPool; unsigned NextStringPoolNumber; std::string StringPref; public: DwarfUnits(AsmPrinter *AP, FoldingSet<DIEAbbrev> *AS, - std::vector<DIEAbbrev *> *A, - StrPool *SP, const char *Pref) : + std::vector<DIEAbbrev *> *A, const char *Pref, + BumpPtrAllocator &DA) : Asm(AP), AbbreviationsSet(AS), Abbreviations(A), - StringPool(SP), NextStringPoolNumber(0), StringPref(Pref) {} + StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {} /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE *Die, unsigned Offset); @@ -254,7 +254,7 @@ public: unsigned getStringPoolIndex(StringRef Str); /// \brief Returns the string pool. - StrPool *getStringPool() { return StringPool; } + StrPool *getStringPool() { return &StringPool; } }; /// \brief Collects and handles dwarf debug information. @@ -290,10 +290,6 @@ class DwarfDebug { // separated by a zero byte, mapped to a unique id. StringMap<unsigned, BumpPtrAllocator&> SourceIdMap; - // A String->Symbol mapping of strings used by indirect - // references. - StrPool InfoStringPool; - // Provides a unique id per text section. SetVector<const MCSection*> SectionMap; @@ -409,9 +405,6 @@ class DwarfDebug { // A list of all the unique abbreviations in use. std::vector<DIEAbbrev *> SkeletonAbbrevs; - // List of strings used in the skeleton. - StrPool SkeletonStringPool; - // Holder for the skeleton information. DwarfUnits SkeletonHolder; |