[llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp
vadve at cs.uiuc.edu
vadve at cs.uiuc.edu
Mon Sep 16 10:19:13 PDT 2002
Changes in directory llvm/lib/CodeGen/InstrSelection:
MachineInstr.cpp updated: 1.45 -> 1.46
---
Log message:
Dump routine now writes out allocated register numbers if available.
---
Diffs of the changes:
Index: llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp
diff -u llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp:1.45 llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp:1.46
--- llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp:1.45 Wed Aug 14 11:52:58 2002
+++ llvm/lib/CodeGen/InstrSelection/MachineInstr.cpp Mon Sep 16 10:18:53 2002
@@ -112,8 +112,8 @@
cerr << " " << *this;
}
-static inline std::ostream &OutputValue(std::ostream &os,
- const Value* val)
+static inline std::ostream&
+OutputValue(std::ostream &os, const Value* val)
{
os << "(val ";
if (val && val->hasName())
@@ -122,6 +122,12 @@
return os << (void*) val << ")"; // print address only
}
+static inline std::ostream&
+OutputReg(std::ostream &os, unsigned int regNum)
+{
+ return os << "%mreg(" << regNum << ")";
+}
+
std::ostream &operator<<(std::ostream& os, const MachineInstr& minstr)
{
os << TargetInstrDescriptors[minstr.opCode].opCodeString;
@@ -165,14 +171,17 @@
case MachineOperand::MO_VirtualRegister:
os << "%reg";
OutputValue(os, mop.getVRegValue());
+ if (mop.hasAllocatedReg())
+ os << "==" << OutputReg(os, mop.getAllocatedRegNum());
break;
case MachineOperand::MO_CCRegister:
os << "%ccreg";
OutputValue(os, mop.getVRegValue());
+ if (mop.hasAllocatedReg())
+ os << "==" << OutputReg(os, mop.getAllocatedRegNum());
break;
case MachineOperand::MO_MachineRegister:
- os << "%reg";
- os << "(" << mop.getMachineRegNum() << ")";
+ OutputReg(os, mop.getMachineRegNum());
break;
case MachineOperand::MO_SignExtendedImmed:
os << (long)mop.immedVal;
More information about the llvm-commits
mailing list