summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-07 21:25:14 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-03-07 21:25:14 -0800
commitbc74a6478aa229abf6dbf7269e67aeeb570e7554 (patch)
treef24fd1e1ed75184abd5d2710a93a4b9a889a3d94 /src/passes/Print.cpp
parent8efa11fbb9ff8cfd8bacc9d16642e13e2bbac9b4 (diff)
parent9407880de631fb4e9f8caa0c746e4d39f40be91d (diff)
downloadbinaryen-bc74a6478aa229abf6dbf7269e67aeeb570e7554.tar.gz
binaryen-bc74a6478aa229abf6dbf7269e67aeeb570e7554.tar.bz2
binaryen-bc74a6478aa229abf6dbf7269e67aeeb570e7554.zip
Merge pull request #231 from WebAssembly/spec-updates
Spec updates
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index e8e917a6e..91c4040f6 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -125,29 +125,16 @@ struct PrintSExpression : public WasmVisitor<PrintSExpression, void> {
decIndent();
}
void visitSwitch(Switch *curr) {
- printOpening(o, "tableswitch ");
- if (curr->name.is()) o << curr->name;
- incIndent();
- printFullLine(curr->value);
- doIndent(o, indent) << "(table";
- std::set<Name> caseNames;
- for (auto& c : curr->cases) {
- caseNames.insert(c.name);
- }
+ printOpening(o, "br_table");
for (auto& t : curr->targets) {
- o << maybeSpace << "(" << (caseNames.count(t) == 0 ? "br" : "case") << " " << (t.is() ? t : curr->default_) << ")";
+ o << " " << t;
}
- o << ")";
- if (curr->default_.is()) o << " (" << (caseNames.count(curr->default_) == 0 ? "br" : "case") << " " << curr->default_ << ")";
- o << maybeNewLine;
- for (auto& c : curr->cases) {
- doIndent(o, indent);
- printMinorOpening(o, "case ") << c.name;
- incIndent();
- printFullLine(c.body);
- decIndent();
- o << maybeNewLine;
+ o << " " << curr->default_;
+ incIndent();
+ if (curr->value) {
+ printFullLine(curr->value);
}
+ printFullLine(curr->condition);
decIndent();
}