summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2015-08-24 21:59:51 +0000
committerJF Bastien <jfb@google.com>2015-08-24 21:59:51 +0000
commitd8a9d66d50a8c86721925eec6a1ab10a6c8d19be (patch)
treefc071951ef0fa1f7db8956d12c8036cad95a888a /llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
parentd8879c85f68250baa6f2ebc463259201782e8460 (diff)
downloadbcm5719-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.cpp13
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);
+ }
+}
OpenPOWER on IntegriCloud