[llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp MachineInstr.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Dec 15 14:36:01 PST 2002
Changes in directory llvm/lib/CodeGen:
MachineFunction.cpp updated: 1.30 -> 1.31
MachineInstr.cpp updated: 1.65 -> 1.66
---
Log message:
Implement printing of MBB arguments
---
Diffs of the changes:
Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.30 llvm/lib/CodeGen/MachineFunction.cpp:1.31
--- llvm/lib/CodeGen/MachineFunction.cpp:1.30 Wed Nov 20 12:55:27 2002
+++ llvm/lib/CodeGen/MachineFunction.cpp Sun Dec 15 14:35:25 2002
@@ -112,8 +112,7 @@
for (const_iterator BB = begin(); BB != end(); ++BB) {
BasicBlock *LBB = BB->getBasicBlock();
- OS << "\n" << LBB->getName() << " ("
- << (const void*)BB->getBasicBlock() << "):\n";
+ OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n";
for (MachineBasicBlock::const_iterator I = BB->begin(); I != BB->end();++I){
OS << "\t";
(*I)->print(OS, Target);
Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.65 llvm/lib/CodeGen/MachineInstr.cpp:1.66
--- llvm/lib/CodeGen/MachineInstr.cpp:1.65 Sun Nov 17 17:22:13 2002
+++ llvm/lib/CodeGen/MachineInstr.cpp Sun Dec 15 14:35:25 2002
@@ -260,6 +260,12 @@
OS << ")";
break;
}
+ case MachineOperand::MO_MachineBasicBlock:
+ OS << "bb<"
+ << ((Value*)MO.getMachineBasicBlock()->getBasicBlock())->getName()
+ << "," << (void*)MO.getMachineBasicBlock()->getBasicBlock() << ">";
+ break;
+
default:
assert(0 && "Unrecognized operand type");
}
@@ -335,47 +341,47 @@
return os << "\n";
}
-std::ostream &operator<<(std::ostream &os, const MachineOperand &mop)
+std::ostream &operator<<(std::ostream &os, const MachineOperand &MO)
{
- if (mop.opHiBits32())
+ if (MO.opHiBits32())
os << "%lm(";
- else if (mop.opLoBits32())
+ else if (MO.opLoBits32())
os << "%lo(";
- else if (mop.opHiBits64())
+ else if (MO.opHiBits64())
os << "%hh(";
- else if (mop.opLoBits64())
+ else if (MO.opLoBits64())
os << "%hm(";
- switch (mop.getType())
+ switch (MO.getType())
{
case MachineOperand::MO_VirtualRegister:
os << "%reg";
- OutputValue(os, mop.getVRegValue());
- if (mop.hasAllocatedReg()) {
+ OutputValue(os, MO.getVRegValue());
+ if (MO.hasAllocatedReg()) {
os << "==";
- OutputReg(os, mop.getAllocatedRegNum());
+ OutputReg(os, MO.getAllocatedRegNum());
}
break;
case MachineOperand::MO_CCRegister:
os << "%ccreg";
- OutputValue(os, mop.getVRegValue());
- if (mop.hasAllocatedReg()) {
+ OutputValue(os, MO.getVRegValue());
+ if (MO.hasAllocatedReg()) {
os << "==";
- OutputReg(os, mop.getAllocatedRegNum());
+ OutputReg(os, MO.getAllocatedRegNum());
}
break;
case MachineOperand::MO_MachineRegister:
- OutputReg(os, mop.getMachineRegNum());
+ OutputReg(os, MO.getMachineRegNum());
break;
case MachineOperand::MO_SignExtendedImmed:
- os << (long)mop.getImmedValue();
+ os << (long)MO.getImmedValue();
break;
case MachineOperand::MO_UnextendedImmed:
- os << (long)mop.getImmedValue();
+ os << (long)MO.getImmedValue();
break;
case MachineOperand::MO_PCRelativeDisp:
{
- const Value* opVal = mop.getVRegValue();
+ const Value* opVal = MO.getVRegValue();
bool isLabel = isa<Function>(opVal) || isa<BasicBlock>(opVal);
os << "%disp(" << (isLabel? "label " : "addr-of-val ");
if (opVal->hasName())
@@ -385,12 +391,17 @@
os << ")";
break;
}
+ case MachineOperand::MO_MachineBasicBlock:
+ os << "bb<"
+ << ((Value*)MO.getMachineBasicBlock()->getBasicBlock())->getName()
+ << "," << (void*)MO.getMachineBasicBlock()->getBasicBlock() << ">";
+ break;
default:
assert(0 && "Unrecognized operand type");
break;
}
- if (mop.flags &
+ if (MO.flags &
(MachineOperand::HIFLAG32 | MachineOperand::LOFLAG32 |
MachineOperand::HIFLAG64 | MachineOperand::LOFLAG64))
os << ")";
More information about the llvm-commits
mailing list