diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-06 14:08:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-06 14:08:17 -0800 |
commit | b99d42ef849a5e655be40d6514d24bafe5febf79 (patch) | |
tree | f48e3bb294923c547acfed5259bebe753377ee66 /src | |
parent | 2de858ae8ed2d33011d7c0ad224438033cacc2e4 (diff) | |
download | binaryen-b99d42ef849a5e655be40d6514d24bafe5febf79.tar.gz binaryen-b99d42ef849a5e655be40d6514d24bafe5febf79.tar.bz2 binaryen-b99d42ef849a5e655be40d6514d24bafe5febf79.zip |
parse select
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-s-parser.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index aa7ef42b9..1ed23b190 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -462,6 +462,7 @@ public: abort_on(op); } case 's': { + if (op[1] == 'e') return makeSelect(s, type); if (op[1] == 'h') { if (op[2] == 'l') return makeBinary(s, BinaryOp::Shl, type); return makeBinary(s, op[4] == 'u' ? BinaryOp::ShrU : BinaryOp::ShrS, type); @@ -580,6 +581,15 @@ private: return ret; } + Expression* makeSelect(Element& s, WasmType type) { + auto ret = allocator.alloc<Select>(); + ret->condition = parseExpression(s[1]); + ret->ifTrue = parseExpression(s[2]); + ret->ifFalse = parseExpression(s[3]); + ret->type = type; + return ret; + } + Expression* makeHost(Element& s, HostOp op) { auto ret = allocator.alloc<Host>(); ret->op = op; |