Verify that MachineMemOperand alignment is a non-zero power of 2.
[oota-llvm.git] / lib / CodeGen / DwarfWriter.cpp
index 68ec6c49ac35efde57552af2310b51e7efb018b6..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"
@@ -827,7 +826,7 @@ protected:
   ///
   AsmPrinter *Asm;
   
-  /// TAI - Target Asm Printer.
+  /// TAI - Target asm information.
   const TargetAsmInfo *TAI;
   
   /// TD - Target data.
@@ -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() || 
-          !MF->getFunction()->doesNotThrow() ||
-          UnwindTablesMandatory)
+      if (!MF->getFunction()->doesNotThrow() || UnwindTablesMandatory)
         shouldEmitMoves = true;
 
       if (shouldEmitMoves || shouldEmitTable)