aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorRuchira Sasanka <sasanka@students.uiuc.edu>2001-09-15 19:07:45 +0000
committerRuchira Sasanka <sasanka@students.uiuc.edu>2001-09-15 19:07:45 +0000
commited8f674b9a18312886355288ac49f9a2dd5e4e94 (patch)
treef8d51c34386df4fe7c6fcccca7336998417fc8fd /lib/CodeGen/MachineInstr.cpp
parent0931a01f57c2ebcf7a35b5d2f1a6971822336f3b (diff)
added setRegForValue to MachineOperand class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index e5b768eca9..bbe2144f23 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -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