Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
some uses of std::vector, where it's return std::vector by value. Yuck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52800 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index cc5cf4d..f068744 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -20,6 +20,7 @@
 #include "llvm/Module.h"
 #include "llvm/Type.h"
 #include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/MachineDebugInfoDesc.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineLocation.h"
@@ -2621,25 +2622,23 @@
   /// ConstructGlobalDIEs - Create DIEs for each of the externally visible
   /// global variables.
   void ConstructGlobalDIEs() {
-    std::vector<GlobalVariableDesc *> GlobalVariables =
-        MMI->getAnchoredDescriptors<GlobalVariableDesc>(*M);
+    std::vector<void*> GlobalVariables;
+    GlobalVariableDesc GVD;
+    MMI->getAnchoredDescriptors(*M, &GVD, GlobalVariables);
     
-    for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) {
-      GlobalVariableDesc *GVD = GlobalVariables[i];
-      NewGlobalVariable(GVD);
-    }
+    for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i)
+      NewGlobalVariable((GlobalVariableDesc *)GlobalVariables[i]);
   }
 
   /// ConstructSubprogramDIEs - Create DIEs for each of the externally visible
   /// subprograms.
   void ConstructSubprogramDIEs() {
-    std::vector<SubprogramDesc *> Subprograms =
-        MMI->getAnchoredDescriptors<SubprogramDesc>(*M);
+    std::vector<void*> Subprograms;
+    SubprogramDesc SPD;
+    MMI->getAnchoredDescriptors(*M, &SPD, Subprograms);
     
-    for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) {
-      SubprogramDesc *SPD = Subprograms[i];
-      NewSubprogram(SPD);
-    }
+    for (unsigned i = 0, N = Subprograms.size(); i < N; ++i)
+      NewSubprogram((SubprogramDesc*)Subprograms[i]);
   }
 
 public: