diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 49ceab70415..7e778c6efd7 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -282,7 +282,6 @@ static void OutputReg(std::ostream &os, unsigned RegNo, static void print(const MachineOperand &MO, std::ostream &OS, const TargetMachine *TM) { const MRegisterInfo *MRI = 0; - if (TM) MRI = TM->getRegisterInfo(); switch (MO.getType()) { @@ -302,7 +301,9 @@ static void print(const MachineOperand &MO, std::ostream &OS, OS << ""; break; case MachineOperand::MO_ConstantPoolIndex: - OS << ""; + OS << ""; break; case MachineOperand::MO_JumpTableIndex: OS << ""; @@ -393,37 +394,6 @@ void MachineInstr::print(std::ostream &os) const { } void MachineOperand::print(std::ostream &OS) const { - switch (getType()) { - case MO_Register: - OutputReg(OS, getReg()); - if (isDef()) OS << ""; - break; - case MO_Immediate: - OS << getImm(); - break; - case MO_MachineBasicBlock: - OS << "getBasicBlock())->getName() - << "@" << (void*)getMachineBasicBlock() << ">"; - break; - case MO_FrameIndex: - OS << ""; - break; - case MO_ConstantPoolIndex: - OS << ""; - break; - case MO_JumpTableIndex: - OS << ""; - break; - case MO_GlobalAddress: - OS << "getName() << ">"; - break; - case MO_ExternalSymbol: - OS << ""; - break; - default: - assert(0 && "Unrecognized operand type"); - break; - } + ::print(*this, OS, 0); }