wire up some basic printOperand goodness, giving us stuff like this before

we abort:

_main:
	stm , 
	mov r7, sp
	sub sp, sp, 
	mov r0, 
	str r0, 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-10-19 20:59:55 +00:00
parent 9cf0eb5e58
commit 8bc86cba60
3 changed files with 34 additions and 20 deletions

View File

@@ -31,3 +31,19 @@ using namespace llvm;
void ARMInstPrinter::printInst(const MCInst *MI) { printInstruction(MI); }
void ARMInstPrinter::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 && "UNIMP");
//O << '$';
//Op.getExpr()->print(O, &MAI);
}
}