diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-10-21 00:12:08 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-10-21 00:12:08 +0000 |
| commit | 4e32bff3828072890f998fdadb1ccbc23a41a42d (patch) | |
| tree | 1dcc9b84b30b94e0f6d4092d1389365cb6eea126 /llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp | |
| parent | 7cea91e1719fbf054821927b3ed7158b42929d75 (diff) | |
| download | bcm5719-llvm-4e32bff3828072890f998fdadb1ccbc23a41a42d.tar.gz bcm5719-llvm-4e32bff3828072890f998fdadb1ccbc23a41a42d.zip | |
Checkpoint MCInst printer. We (almostly) able to print global / JT / constpool entries
llvm-svn: 84706
Diffstat (limited to 'llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp b/llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp index 243a5e1f3ed..84a2e023c4e 100644 --- a/llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp +++ b/llvm/lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp @@ -45,6 +45,30 @@ void MSP430InstPrinter::printOperand(const MCInst *MI, unsigned OpNo, O << '#' << Op.getImm(); } else { assert(Op.isExpr() && "unknown operand kind in printOperand"); - assert(0 && "Unimplemented!"); + Op.getExpr()->print(O, &MAI); } } + +void MSP430InstPrinter::printSrcMemOperand(const MCInst *MI, unsigned OpNo, + const char *Modifier) { + const MCOperand &Base = MI->getOperand(OpNo); + const MCOperand &Disp = MI->getOperand(OpNo+1); + + if (Disp.isImm() && !Base.isReg()) + printOperand(MI, OpNo); + else if (Base.isReg()) { + if (Disp.getImm()) { + O << Disp.getImm() << '('; + printOperand(MI, OpNo); + O << ')'; + } else { + O << '@'; + printOperand(MI, OpNo); + } + } else { + Base.dump(); + Disp.dump(); + llvm_unreachable("Unsupported memory operand"); + } + +} |

