Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 8fc687d..e22d72c 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -149,7 +149,7 @@
                                     mf.getSSARegMap()->getRegClass(virtReg));
                                 loaded[virtReg] = true;
                                 DEBUG(std::cerr << '\t';
-                                      prior(mii)->print(std::cerr, tm));
+                                      prior(mii)->print(std::cerr, &tm));
                                 ++numLoads;
                             }
                             if (mop.isDef() &&
@@ -165,7 +165,7 @@
                             mii->SetMachineOperandReg(i, physReg);
                         }
                     }
-                    DEBUG(std::cerr << '\t'; mii->print(std::cerr, tm));
+                    DEBUG(std::cerr << '\t'; mii->print(std::cerr, &tm));
                     loaded.clear();
                 }
             }
@@ -231,9 +231,9 @@
                                           mri_->getRegClass(physReg));
                 ++numStores;
                 DEBUG(std::cerr << "added: ";
-                      prior(nextLastRef)->print(std::cerr, *tm_);
+                      prior(nextLastRef)->print(std::cerr, tm_);
                       std::cerr << "after: ";
-                      lastDef->print(std::cerr, *tm_));
+                      lastDef->print(std::cerr, tm_));
                 lastDef_[virtReg] = 0;
             }
             p2vMap_[physReg] = 0;
@@ -263,7 +263,7 @@
                                                mri_->getRegClass(physReg));
                     ++numLoads;
                     DEBUG(std::cerr << "added: ";
-                          prior(mii)->print(std::cerr, *tm_));
+                          prior(mii)->print(std::cerr, tm_));
                     lastDef_[virtReg] = mii;
                 }
             }
@@ -339,7 +339,7 @@
                         }
                 }
 
-                DEBUG(std::cerr << '\t'; mii->print(std::cerr, *tm_));
+                DEBUG(std::cerr << '\t'; mii->print(std::cerr, tm_));
             }
 
             for (unsigned i = 1, e = p2vMap_.size(); i != e; ++i)