From 91df1ef41ff23b41c764b358c3c01d5601816844 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 25 May 2006 12:57:06 +0000 Subject: [PATCH] implement initial version of ARMAsmPrinter::printOperand llvm-svn: 28470 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 32 ++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index 2e4dd1706692..0ef22be2e64d 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -133,7 +133,37 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { } void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum) { - assert(0 && "not implemented"); + const MachineOperand &MO = MI->getOperand (opNum); + const MRegisterInfo &RI = *TM.getRegisterInfo(); + switch (MO.getType()) { + case MachineOperand::MO_Register: + if (MRegisterInfo::isPhysicalRegister(MO.getReg())) + O << LowercaseString (RI.get(MO.getReg()).Name); + else + assert(0 && "not implemented"); + break; + case MachineOperand::MO_Immediate: + O << "#" << (int)MO.getImmedValue(); + break; + case MachineOperand::MO_MachineBasicBlock: + assert(0 && "not implemented"); + abort(); + return; + case MachineOperand::MO_GlobalAddress: + assert(0 && "not implemented"); + abort(); + break; + case MachineOperand::MO_ExternalSymbol: + assert(0 && "not implemented"); + abort(); + break; + case MachineOperand::MO_ConstantPoolIndex: + assert(0 && "not implemented"); + abort(); + break; + default: + O << ""; abort (); break; + } } void ARMAsmPrinter::printMemOperand(const MachineInstr *MI, int opNum,