Factor local liveness computation out into its own function.
[oota-llvm.git] / lib / CodeGen / DwarfWriter.cpp
index 569702c59dffe6955e661cb3de6a6b1c44ccc8c3..8ce689f0af4941fd56a033646e9caec1da6d9375 100644 (file)
@@ -20,7 +20,6 @@
 #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"
@@ -2631,23 +2630,25 @@ private:
   /// ConstructGlobalDIEs - Create DIEs for each of the externally visible
   /// global variables.
   void ConstructGlobalDIEs() {
-    std::vector<void*> GlobalVariables;
-    GlobalVariableDesc GVD;
-    MMI->getAnchoredDescriptors(*M, &GVD, GlobalVariables);
+    std::vector<GlobalVariableDesc *> GlobalVariables;
+    MMI->getAnchoredDescriptors<GlobalVariableDesc>(*M, GlobalVariables);
     
-    for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i)
-      NewGlobalVariable((GlobalVariableDesc *)GlobalVariables[i]);
+    for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) {
+      GlobalVariableDesc *GVD = GlobalVariables[i];
+      NewGlobalVariable(GVD);
+    }
   }
 
   /// ConstructSubprogramDIEs - Create DIEs for each of the externally visible
   /// subprograms.
   void ConstructSubprogramDIEs() {
-    std::vector<void*> Subprograms;
-    SubprogramDesc SPD;
-    MMI->getAnchoredDescriptors(*M, &SPD, Subprograms);
+    std::vector<SubprogramDesc *> Subprograms;
+    MMI->getAnchoredDescriptors<SubprogramDesc>(*M, Subprograms);
     
-    for (unsigned i = 0, N = Subprograms.size(); i < N; ++i)
-      NewSubprogram((SubprogramDesc*)Subprograms[i]);
+    for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) {
+      SubprogramDesc *SPD = Subprograms[i];
+      NewSubprogram(SPD);
+    }
   }
 
 public:
@@ -2719,8 +2720,6 @@ public:
   /// content.
   void BeginModule(Module *M) {
     this->M = M;
-    
-    if (!ShouldEmitDwarf()) return;
   }
 
   /// EndModule - Emit all Dwarf sections that should come after the content.
@@ -3511,9 +3510,7 @@ public:
         shouldEmitTable = true;
 
       // See if we need frame move info.
-      if ((MMI->hasDebugInfo() && TAI->doesDebugInfoRequireFrameMoveInfo()) || 
-          !MF->getFunction()->doesNotThrow() ||
-          UnwindTablesMandatory)
+      if (!MF->getFunction()->doesNotThrow() || UnwindTablesMandatory)
         shouldEmitMoves = true;
 
       if (shouldEmitMoves || shouldEmitTable)