From 7da5313d3f20ff4bf491a828726c8b11d88bfa7c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 30 Dec 2007 21:03:30 +0000 Subject: [PATCH] eliminate a copy of the machineoperand printing stuff. Keep the copy that knows how to print offsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45457 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstr.cpp | 38 ++++-------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) 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); }