aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-15 20:35:25 +0000
committerChris Lattner <sabre@nondot.org>2002-12-15 20:35:25 +0000
commit2109f502d646a1bafc7b21a14347a71771a7b4cf (patch)
tree433a8f66a741289a2012cd1d3cc401d768f3b829 /lib/CodeGen/MachineInstr.cpp
parent198ab640bbb0b8e1cdda518b7f8b348764e4402c (diff)
Implement printing of MBB arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index ffd2e6e68f..b21d24d219 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -260,6 +260,12 @@ static void print(const MachineOperand &MO, std::ostream &OS,
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 @@ std::ostream &operator<<(std::ostream& os, const MachineInstr& minstr)
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 @@ std::ostream &operator<<(std::ostream &os, const MachineOperand &mop)
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 << ")";