Arrange for FastISel code to have access to the MachineModuleInfo
object. This will be needed to support debug info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56508 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 3139cb3..4b77322 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -450,7 +450,7 @@
     UpdateValueMap(I, Reg);
     return true;
   }
-  
+
   default:
     // Unhandled instruction. Halt "fast" selection and bail.
     return false;
@@ -458,6 +458,7 @@
 }
 
 FastISel::FastISel(MachineFunction &mf,
+                   MachineModuleInfo *mmi,
                    DenseMap<const Value *, unsigned> &vm,
                    DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
                    DenseMap<const AllocaInst *, int> &am)
@@ -466,6 +467,7 @@
     MBBMap(bm),
     StaticAllocaMap(am),
     MF(mf),
+    MMI(mmi),
     MRI(MF.getRegInfo()),
     MFI(*MF.getFrameInfo()),
     MCP(*MF.getConstantPool()),
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index c2938e3..c1e80fc 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -309,7 +309,8 @@
   DOUT << "\n\n\n=== " << Fn.getName() << "\n";
 
   FuncInfo->set(Fn, MF, EnableFastISel);
-  CurDAG->init(MF, getAnalysisToUpdate<MachineModuleInfo>());
+  MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  CurDAG->init(MF, MMI);
   SDL->init(GFI, *AA);
 
   for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
@@ -317,7 +318,7 @@
       // Mark landing pad.
       FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
 
-  SelectAllBasicBlocks(Fn, MF);
+  SelectAllBasicBlocks(Fn, MF, MMI);
 
   // If the first basic block in the function has live ins that need to be
   // copied into vregs, emit the copies into the top of the block before
@@ -710,7 +711,8 @@
   DEBUG(BB->dump());
 }  
 
-void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) {
+void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
+                                            MachineModuleInfo *MMI) {
   for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
     BasicBlock *LLVMBB = &*I;
     BB = FuncInfo->MBBMap[LLVMBB];
@@ -726,7 +728,8 @@
     // Before doing SelectionDAG ISel, see if FastISel has been requested.
     // FastISel doesn't support EH landing pads, which require special handling.
     if (EnableFastISel && !BB->isLandingPad()) {
-      if (FastISel *F = TLI.createFastISel(*FuncInfo->MF, FuncInfo->ValueMap,
+      if (FastISel *F = TLI.createFastISel(*FuncInfo->MF, MMI,
+                                           FuncInfo->ValueMap,
                                            FuncInfo->MBBMap,
                                            FuncInfo->StaticAllocaMap)) {
         // Emit code for any incoming arguments. This must happen before