X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FPowerPC%2FInstPrinter%2FPPCInstPrinter.cpp;h=8f34b19925ee40d7c34484c57553c8eabdb4c334;hb=94b9550a32d189704a8eae55505edf62662c0534;hp=0af16cfc8e37ee36bad47adaa678dd695afb850f;hpb=1e61e69d401045c54b15815f15a0fdb3ca56a9b5;p=oota-llvm.git diff --git a/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp index 0af16cfc8e3..8f34b19925e 100644 --- a/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp +++ b/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp @@ -13,27 +13,25 @@ #define DEBUG_TYPE "asm-printer" #include "PPCInstPrinter.h" -#include "PPCPredicates.h" +#include "MCTargetDesc/PPCBaseInfo.h" +#include "MCTargetDesc/PPCPredicates.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" -//#include "llvm/MC/MCAsmInfo.h" -//#include "llvm/ADT/StringExtras.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; #define GET_INSTRUCTION_NAME -#define PPCAsmPrinter PPCInstPrinter -#define MachineInstr MCInst #include "PPCGenAsmWriter.inc" StringRef PPCInstPrinter::getOpcodeName(unsigned Opcode) const { return getInstructionName(Opcode); } +void PPCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { + OS << getRegisterName(RegNo); +} void PPCInstPrinter::printInst(const MCInst *MI, raw_ostream &O) { - // TODO: pseudo ops. - // Check for slwi/srwi mnemonics. if (MI->getOpcode() == PPC::RLWINM) { unsigned char SH = MI->getOperand(2).getImm(); @@ -188,10 +186,7 @@ void PPCInstPrinter::printMemRegImm(const MCInst *MI, unsigned OpNo, raw_ostream &O) { printSymbolLo(MI, OpNo, O); O << '('; - assert(MI->getOperand(OpNo+1).isReg() && "Bad operand"); - // FIXME: Simplify. - if (MI->getOperand(OpNo+1).isReg() && - MI->getOperand(OpNo+1).getReg() == PPC::R0) + if (MI->getOperand(OpNo+1).getReg() == PPC::R0) O << "0"; else printOperand(MI, OpNo+1, O); @@ -206,10 +201,7 @@ void PPCInstPrinter::printMemRegImmShifted(const MCInst *MI, unsigned OpNo, printSymbolLo(MI, OpNo, O); O << '('; - assert(MI->getOperand(OpNo+1).isReg() && "Bad operand"); - // FIXME: Simplify. - if (MI->getOperand(OpNo+1).isReg() && - MI->getOperand(OpNo+1).getReg() == PPC::R0) + if (MI->getOperand(OpNo+1).getReg() == PPC::R0) O << "0"; else printOperand(MI, OpNo+1, O); @@ -234,7 +226,7 @@ void PPCInstPrinter::printMemRegReg(const MCInst *MI, unsigned OpNo, /// stripRegisterPrefix - This method strips the character prefix from a /// register name so that only the number is left. Used by for linux asm. -const char *stripRegisterPrefix(const char *RegName) { +static const char *stripRegisterPrefix(const char *RegName) { switch (RegName[0]) { case 'r': case 'f': @@ -302,16 +294,3 @@ void PPCInstPrinter::printSymbolHi(const MCInst *MI, unsigned OpNo, } -void PPCInstPrinter::PrintSpecial(const MCInst *MI, raw_ostream &O, - const char *Modifier) { - assert(0 && "FIXME: PrintSpecial should be dead"); -} -void PPCInstPrinter::printPICLabel(const MCInst *MI, unsigned OpNo, - raw_ostream &O) { - assert(0 && "FIXME: printPICLabel should be dead"); -} -void PPCInstPrinter::printTOCEntryLabel(const MCInst *MI, unsigned OpNo, - raw_ostream &O) { - assert(0 && "FIXME: printTOCEntryLabel should be dead"); -} -