diff options
| author | Eric Christopher <echristo@gmail.com> | 2012-12-20 21:58:36 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2012-12-20 21:58:36 +0000 |
| commit | e698f5374058cffc272e6021b0cf56d53731584f (patch) | |
| tree | 24789ca4e3739395ec1341ffefdc86d870c9fefb /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | |
| parent | eae2d9050861d801cfadfa1321ab527d7ad5d916 (diff) | |
| download | bcm5719-llvm-e698f5374058cffc272e6021b0cf56d53731584f.tar.gz bcm5719-llvm-e698f5374058cffc272e6021b0cf56d53731584f.zip | |
Start splitting out the debug string section handling by moving it
into the DwarfUnits class.
llvm-svn: 170770
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 58ae3d68d14..71e78c22117 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -189,6 +189,12 @@ public: DIType getType() const; }; + +// A String->Symbol mapping of strings used by indirect +// references. +typedef StringMap<std::pair<MCSymbol*, unsigned>, + BumpPtrAllocator&> StrPool; + /// \brief Collects and handles information specific to a particular /// collection of units. class DwarfUnits { @@ -204,10 +210,15 @@ class DwarfUnits { // A pointer to all units in the section. SmallVector<CompileUnit *, 1> CUs; + // Collection of strings for this unit. + StrPool *StringPool; + unsigned NextStringPoolNumber; + public: DwarfUnits(AsmPrinter *AP, FoldingSet<DIEAbbrev> *AS, - std::vector<DIEAbbrev *> *A) : - Asm(AP), AbbreviationsSet(AS), Abbreviations(A) {} + std::vector<DIEAbbrev *> *A, StrPool *SP) : + Asm(AP), AbbreviationsSet(AS), Abbreviations(A), + StringPool(SP), NextStringPoolNumber(0) {} /// \brief Compute the size and offset of a DIE given an incoming Offset. unsigned computeSizeAndOffset(DIE *Die, unsigned Offset); @@ -225,6 +236,16 @@ public: /// abbreviation section. void emitUnits(DwarfDebug *, const MCSection *, const MCSection *, const MCSymbol *); + + /// \brief Returns the entry into the start of the pool. + MCSymbol *getStringPoolSym(); + + /// \brief Returns an entry into the string pool with the given + /// string text. + MCSymbol *getStringPoolEntry(StringRef Str); + + /// \brief Returns the string pool. + StrPool *getStringPool() { return StringPool; } }; /// \brief Collects and handles dwarf debug information. @@ -262,8 +283,7 @@ class DwarfDebug { // A String->Symbol mapping of strings used by indirect // references. - StringMap<std::pair<MCSymbol*, unsigned>, BumpPtrAllocator&> StringPool; - unsigned NextStringPoolNumber; + StrPool InfoStringPool; // Provides a unique id per text section. SetVector<const MCSection*> SectionMap; @@ -579,13 +599,6 @@ public: /// SourceIds map. unsigned getOrCreateSourceID(StringRef DirName, StringRef FullName); - /// \brief Returns the entry into the start of the pool. - MCSymbol *getStringPool(); - - /// \brief Returns an entry into the string pool with the given - /// string text. - MCSymbol *getStringPoolEntry(StringRef Str); - /// \brief Recursively Emits a debug information entry. void emitDIE(DIE *Die, std::vector<DIEAbbrev *> *Abbrevs); |

