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
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 58ae3d6..71e78c2 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -189,6 +189,12 @@
   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 @@
   // 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 @@
   /// 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 @@
 
   // 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 @@
   /// 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);