aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.h
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-12-20 21:58:36 +0000
committerEric Christopher <echristo@gmail.com>2012-12-20 21:58:36 +0000
commit2e5d870b384f7cc20ba040e827d54fa473f60800 (patch)
tree21662879dddafc544475fc201c2f1640033f06c3 /lib/CodeGen/AsmPrinter/DwarfDebug.h
parent55d8a35fb728f4e686b75151a20c92402a9f29fa (diff)
Start splitting out the debug string section handling by moving it
into the DwarfUnits class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 58ae3d68d1..71e78c2211 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/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);