diff options
| author | JF Bastien <jfb@google.com> | 2015-08-24 21:59:51 +0000 |
|---|---|---|
| committer | JF Bastien <jfb@google.com> | 2015-08-24 21:59:51 +0000 |
| commit | d8a9d66d50a8c86721925eec6a1ab10a6c8d19be (patch) | |
| tree | fc071951ef0fa1f7db8956d12c8036cad95a888a /llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp | |
| parent | d8879c85f68250baa6f2ebc463259201782e8460 (diff) | |
| download | bcm5719-llvm-d8a9d66d50a8c86721925eec6a1ab10a6c8d19be.tar.gz bcm5719-llvm-d8a9d66d50a8c86721925eec6a1ab10a6c8d19be.zip | |
call
llvm-svn: 245882
Diffstat (limited to 'llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp index 0c5792c6b51..cbd2f7dc748 100644 --- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp +++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp @@ -44,3 +44,16 @@ void WebAssemblyInstPrinter::printInst(const MCInst *MI, raw_ostream &OS, printInstruction(MI, OS); printAnnotation(OS, Annot); } + +void WebAssemblyInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, + raw_ostream &O) { + 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"); + Op.getExpr()->print(O, &MAI); + } +} |

