added setRegForValue to MachineOperand class
authorRuchira Sasanka <sasanka@students.uiuc.edu>
Sat, 15 Sep 2001 19:07:45 +0000 (19:07 +0000)
committerRuchira Sasanka <sasanka@students.uiuc.edu>
Sat, 15 Sep 2001 19:07:45 +0000 (19:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@591 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp

index e5b768eca993e2f5b96b755eca118188a5ed734f..bbe2144f237852feeae4822aa8e675dd2c076257 100644 (file)
@@ -345,7 +345,31 @@ ChooseRegOrImmed(Value* val,
 
 
 void
-PrintMachineInstructions(const Method* method)
+PrintMachineInstructions(const Method *const method)
+{
+  cout << "\n" << method->getReturnType()
+       << " \"" << method->getName() << "\"" << endl;
+  
+  for (Method::const_iterator BI = method->begin(); BI != method->end(); ++BI)
+    {
+      BasicBlock* bb = *BI;
+      cout << "\n"
+          << (bb->hasName()? bb->getName() : "Label")
+          << " (" << bb << ")" << ":"
+          << endl;
+      
+      MachineCodeForBasicBlock& mvec = bb->getMachineInstrVec();
+      for (unsigned i=0; i < mvec.size(); i++)
+       cout << "\t" << *mvec[i] << endl;
+    } 
+  cout << endl << "End method \"" << method->getName() << "\""
+       << endl << endl;
+}
+
+#if 0
+
+void PrintMachineInstructions(Method * method)
+
 {
   cout << "\n" << method->getReturnType()
        << " \"" << method->getName() << "\"" << endl;
@@ -365,3 +389,4 @@ PrintMachineInstructions(const Method* method)
   cout << endl << "End method \"" << method->getName() << "\""
        << endl << endl;
 }
+#endif