summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/InstPrinter
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-10-25 16:55:52 +0000
committerDan Gohman <dan433584@gmail.com>2016-10-25 16:55:52 +0000
commitf50d964bdb0674db3e7f18d06a2d1964e0dbd731 (patch)
tree2deb35973b98edbdd41cadfef6871e2f6e27dcaa /llvm/lib/Target/WebAssembly/InstPrinter
parentc1472b509202b168e9a4b4a468eaa4a12769a38d (diff)
downloadbcm5719-llvm-f50d964bdb0674db3e7f18d06a2d1964e0dbd731.tar.gz
bcm5719-llvm-f50d964bdb0674db3e7f18d06a2d1964e0dbd731.zip
[WebAssembly] Add immediate fields to call_indirect and memory operators.
call_indirect, grow_memory, and current_memory now have immediate operands in the 0xd binary encoding. llvm-svn: 285085
Diffstat (limited to 'llvm/lib/Target/WebAssembly/InstPrinter')
-rw-r--r--llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
index a1710dd5d6d..00afb88931e 100644
--- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
@@ -54,7 +54,12 @@ void WebAssemblyInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
const MCInstrDesc &Desc = MII.get(MI->getOpcode());
if (Desc.isVariadic())
for (auto i = Desc.getNumOperands(), e = MI->getNumOperands(); i < e; ++i) {
- if (i != 0)
+ // FIXME: For CALL_INDIRECT_VOID, don't print a leading comma, because
+ // we have an extra flags operand which is not currently printed, for
+ // compatiblity reasons.
+ if (i != 0 &&
+ (MI->getOpcode() != WebAssembly::CALL_INDIRECT_VOID ||
+ i != Desc.getNumOperands()))
OS << ", ";
printOperand(MI, i, OS);
}
OpenPOWER on IntegriCloud