mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-05 03:46:27 +00:00
Add simple operand printing stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
13853e233b
commit
b5a921679f
@ -33,3 +33,18 @@ using namespace llvm;
|
||||
void MSP430InstPrinter::printInst(const MCInst *MI) {
|
||||
printInstruction(MI);
|
||||
}
|
||||
|
||||
void MSP430InstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
|
||||
const char *Modifier) {
|
||||
assert((Modifier == 0 || Modifier[0] == 0) && "Cannot print modifiers");
|
||||
|
||||
const MCOperand &Op = MI->getOperand(OpNo);
|
||||
if (Op.isReg()) {
|
||||
O << getRegisterName(Op.getReg());
|
||||
} else if (Op.isImm()) {
|
||||
O << '#' << Op.getImm();
|
||||
} else {
|
||||
assert(Op.isExpr() && "unknown operand kind in printOperand");
|
||||
assert(0 && "Unimplemented!");
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include "llvm/MC/MCInstPrinter.h"
|
||||
|
||||
namespace llvm
|
||||
namespace llvm
|
||||
{
|
||||
|
||||
class MCOperand;
|
||||
@ -34,10 +34,10 @@ namespace llvm
|
||||
static const char *getRegisterName(unsigned RegNo);
|
||||
|
||||
void printOperand(const MCInst *MI, unsigned OpNo,
|
||||
const char *Modifier = 0) {
|
||||
}
|
||||
const char *Modifier = 0);
|
||||
|
||||
void printSrcMemOperand(const MCInst *MI, unsigned OpNo,
|
||||
const char *Modifier = 0) {
|
||||
const char *Modifier = 0) {
|
||||
}
|
||||
void printCCOperand(const MCInst *MI, unsigned OpNo) {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user