Skip to content

Commit

Permalink
update select changes in spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Mar 2, 2016
1 parent af8073f commit 14cc71b
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 188 deletions.
2 changes: 1 addition & 1 deletion src/passes/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ struct PrintSExpression : public WasmVisitor<PrintSExpression, void> {
}
void visitSelect(Select *curr) {
o << '(';
prepareColor(o) << printWasmType(curr->type) << ".select";
prepareColor(o) << "select";
incIndent();
printFullLine(curr->ifTrue);
printFullLine(curr->ifFalse);
Expand Down
8 changes: 4 additions & 4 deletions src/wasm-s-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ class SExpressionWasmBuilder {
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);
Expand Down Expand Up @@ -598,7 +597,8 @@ class SExpressionWasmBuilder {
abort_on(str);
}
case 's': {
if (str[1] == 'e') return makeSetLocal(s);
if (str[1] == 'e' && str[2] == 't') return makeSetLocal(s);
if (str[1] == 'e' && str[2] == 'l') return makeSelect(s);
abort_on(str);
}
case 'r': {
Expand Down Expand Up @@ -637,12 +637,12 @@ class SExpressionWasmBuilder {
return ret;
}

Expression* makeSelect(Element& s, WasmType type) {
Expression* makeSelect(Element& s) {
auto ret = allocator.alloc<Select>();
ret->ifTrue = parseExpression(s[1]);
ret->ifFalse = parseExpression(s[2]);
ret->condition = parseExpression(s[3]);
ret->type = type;
ret->finalize();
return ret;
}

Expand Down
Loading

0 comments on commit 14cc71b

Please sign in to comment.