diff options
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp b/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp index 8fc5de6a82e..039ccce7981 100644 --- a/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -51,6 +51,7 @@ namespace { const char* Modifier = 0); void printSrcMemOperand(const MachineInstr *MI, int OpNum, const char* Modifier = 0); + void printCCOperand(const MachineInstr *MI, int OpNum); bool printInstruction(const MachineInstr *MI); // autogenerated. void printMachineInstruction(const MachineInstr * MI); bool runOnMachineFunction(MachineFunction &F); @@ -182,3 +183,30 @@ void MSP430AsmPrinter::printSrcMemOperand(const MachineInstr *MI, int OpNum, assert(0 && "Unsupported memory operand"); } +void MSP430AsmPrinter::printCCOperand(const MachineInstr *MI, int OpNum) { + unsigned CC = MI->getOperand(OpNum).getImm(); + + switch (CC) { + default: + assert(0 && "Unsupported CC code"); + break; + case MSP430::COND_E: + O << 'e'; + break; + case MSP430::COND_NE: + O << "ne"; + break; + case MSP430::COND_HS: + O << "hs"; + break; + case MSP430::COND_LO: + O << "lo"; + break; + case MSP430::COND_GE: + O << "ge"; + break; + case MSP430::COND_L: + O << 'l'; + break; + } +} |

