Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index de12dfa..1fba4e1 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -23,7 +23,7 @@
 #include "llvm/Module.h"
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineJumpTableInfo.h"
 #include "llvm/Target/TargetAsmInfo.h"
@@ -142,7 +142,7 @@
     
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
-      AU.addRequired<MachineDebugInfo>();
+      AU.addRequired<MachineModuleInfo>();
     }
   };
 } // end of anonymous namespace
@@ -166,7 +166,7 @@
   AFI = MF.getInfo<ARMFunctionInfo>();
 
   if (Subtarget->isTargetDarwin()) {
-    DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+    DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
   }
 
   SetupMachineFunction(MF);
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 81926ed..3945d1a 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -27,7 +27,7 @@
 #include "llvm/Assembly/Writer.h"
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Support/Mangler.h"
@@ -302,7 +302,7 @@
     
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
-      AU.addRequired<MachineDebugInfo>();
+      AU.addRequired<MachineModuleInfo>();
       PPCAsmPrinter::getAnalysisUsage(AU);
     }
 
@@ -332,7 +332,7 @@
     
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
-      AU.addRequired<MachineDebugInfo>();
+      AU.addRequired<MachineModuleInfo>();
       PPCAsmPrinter::getAnalysisUsage(AU);
     }
 
@@ -528,7 +528,7 @@
 /// method to print assembly for each instruction.
 ///
 bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
-  DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+  DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
 
   SetupMachineFunction(MF);
   O << "\n\n";
@@ -738,7 +738,7 @@
 /// method to print assembly for each instruction.
 ///
 bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
-  DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+  DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
 
   SetupMachineFunction(MF);
   O << "\n\n";
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.cpp b/lib/Target/PowerPC/PPCRegisterInfo.cpp
index 75c9261..9228b3e 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ b/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -22,7 +22,7 @@
 #include "llvm/Type.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineLocation.h"
@@ -754,10 +754,10 @@
   MachineBasicBlock &MBB = MF.front();   // Prolog goes in entry BB
   MachineBasicBlock::iterator MBBI = MBB.begin();
   MachineFrameInfo *MFI = MF.getFrameInfo();
-  MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo();
+  MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
   
   // Prepare for debug frame info.
-  bool hasInfo = DebugInfo && DebugInfo->hasInfo();
+  bool hasDebugInfo = MMI && MMI->hasDebugInfo();
   unsigned FrameLabelId = 0;
   
   // Scan the prolog, looking for an UPDATE_VRSAVE instruction.  If we find it,
@@ -819,9 +819,9 @@
   unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment();
   unsigned MaxAlign = MFI->getMaxAlignment();
 
-  if (hasInfo) {
+  if (hasDebugInfo) {
     // Mark effective beginning of when frame pointer becomes valid.
-    FrameLabelId = DebugInfo->NextLabelID();
+    FrameLabelId = MMI->NextLabelID();
     BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(FrameLabelId);
   }
   
@@ -870,8 +870,8 @@
     }
   }
   
-  if (hasInfo) {
-    std::vector<MachineMove> &Moves = DebugInfo->getFrameMoves();
+  if (hasDebugInfo) {
+    std::vector<MachineMove> &Moves = MMI->getFrameMoves();
     
     if (NegFrameSize) {
       // Show update of SP.
@@ -901,7 +901,7 @@
     }
     
     // Mark effective beginning of when frame pointer is ready.
-    unsigned ReadyLabelId = DebugInfo->NextLabelID();
+    unsigned ReadyLabelId = MMI->NextLabelID();
     BuildMI(MBB, MBBI, TII.get(PPC::LABEL)).addImm(ReadyLabelId);
     
     MachineLocation FPDst(HasFP ? (IsPPC64 ? PPC::X31 : PPC::R31) :
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp
index 6a07f90..92abfc5 100755
--- a/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -75,8 +75,8 @@
       Subtarget->isTargetELF() ||
       Subtarget->isTargetCygMing()) {
     // Let PassManager know we need debug information and relay
-    // the MachineDebugInfo address on to DwarfWriter.
-    DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+    // the MachineModuleInfo address on to DwarfWriter.
+    DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
   }
 
   SetupMachineFunction(MF);
diff --git a/lib/Target/X86/X86AsmPrinter.h b/lib/Target/X86/X86AsmPrinter.h
index 87f1852..abbedf2 100755
--- a/lib/Target/X86/X86AsmPrinter.h
+++ b/lib/Target/X86/X86AsmPrinter.h
@@ -21,7 +21,7 @@
 #include "X86TargetMachine.h"
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/DwarfWriter.h"
-#include "llvm/CodeGen/MachineDebugInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/Support/Compiler.h"
 #include <set>
 
@@ -61,7 +61,7 @@
     if (Subtarget->isTargetDarwin() ||
         Subtarget->isTargetELF() ||
         Subtarget->isTargetCygMing()) {
-      AU.addRequired<MachineDebugInfo>();
+      AU.addRequired<MachineModuleInfo>();
     }
     MachineFunctionPass::getAnalysisUsage(AU);
   }
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 4b13dac..e6500bc 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -995,10 +995,10 @@
   const Function* Fn = MF.getFunction();
   const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget<X86Subtarget>();
   MachineInstr *MI;
-  MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo();
+  MachineModuleInfo *MMI = MFI->getMachineModuleInfo();
   
   // Prepare for debug frame info.
-  bool hasInfo = DebugInfo && DebugInfo->hasInfo();
+  bool hasDebugInfo = MMI && MMI->hasDebugInfo();
   unsigned FrameLabelId = 0;
   
   // Get the number of bytes to allocate from the FrameInfo
@@ -1023,9 +1023,9 @@
     }
   }
 
-  if (hasInfo) {
+  if (hasDebugInfo) {
     // Mark effective beginning of when frame pointer becomes valid.
-    FrameLabelId = DebugInfo->NextLabelID();
+    FrameLabelId = MMI->NextLabelID();
     BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(FrameLabelId);
   }
   
@@ -1053,8 +1053,8 @@
     MBB.insert(MBBI, MI);
   }
 
-  if (hasInfo) {
-    std::vector<MachineMove> &Moves = DebugInfo->getFrameMoves();
+  if (hasDebugInfo) {
+    std::vector<MachineMove> &Moves = MMI->getFrameMoves();
     
     if (NumBytes) {
       // Show update of SP.
@@ -1077,7 +1077,7 @@
     }
     
     // Mark effective beginning of when frame pointer is ready.
-    unsigned ReadyLabelId = DebugInfo->NextLabelID();
+    unsigned ReadyLabelId = MMI->NextLabelID();
     BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(ReadyLabelId);
     
     MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr);