summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-06-12 16:50:28 -0700
committerGitHub <noreply@github.com>2017-06-12 16:50:28 -0700
commit68dc2eddc24844c7582cafa85afeb4023a47888f (patch)
treefcaedc839420fe43c555166420865d5aeef0dbfa /src/passes/Print.cpp
parent93c65f98b7a9b0977578dbf55778529efec646f1 (diff)
downloadbinaryen-68dc2eddc24844c7582cafa85afeb4023a47888f.tar.gz
binaryen-68dc2eddc24844c7582cafa85afeb4023a47888f.tar.bz2
binaryen-68dc2eddc24844c7582cafa85afeb4023a47888f.zip
Support new result syntax for if/loop/block (#1047)
Support both syntax formats in input since the old spec tests still need to be parsable.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 95f60e5e2..340266fcf 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -134,7 +134,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
printName(curr->name);
}
if (isConcreteWasmType(curr->type)) {
- o << ' ' << printWasmType(curr->type);
+ o << " (result " << printWasmType(curr->type) << ')';
}
incIndent();
if (curr->list.size() > 0 && curr->list[0]->is<Block>()) {
@@ -165,7 +165,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
void visitIf(If *curr) {
printOpening(o, "if");
if (isConcreteWasmType(curr->type)) {
- o << ' ' << printWasmType(curr->type);
+ o << " (result " << printWasmType(curr->type) << ')';
}
incIndent();
printFullLine(curr->condition);
@@ -190,7 +190,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
o << ' ' << curr->name;
}
if (isConcreteWasmType(curr->type)) {
- o << ' ' << printWasmType(curr->type);
+ o << " (result " << printWasmType(curr->type) << ')';
}
incIndent();
auto block = curr->body->dynCast<Block>();