summaryrefslogtreecommitdiff
path: root/src/passes/pass.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-04-10 10:44:07 -0700
committerGitHub <noreply@github.com>2018-04-10 10:44:07 -0700
commitdf19ebde22c48fba43f88c71c4870f53b8974f93 (patch)
treec9e44c9d05045954c082fabd5eaf4f4d465e7aa7 /src/passes/pass.cpp
parent27517701d611ad7de5b467eaee2f0d589180465f (diff)
downloadbinaryen-df19ebde22c48fba43f88c71c4870f53b8974f93.tar.gz
binaryen-df19ebde22c48fba43f88c71c4870f53b8974f93.tar.bz2
binaryen-df19ebde22c48fba43f88c71c4870f53b8974f93.zip
br_table optimizations (#1502)
Inspired by #1501 * remove unneeded appearances of the default switch target (at the front or back of the list of targets) * optimize a switch with 0, 1 or 2 targets into an if or if-chain * optimize a br_if br pair when they have the same target Makes e.g. fastcomp libc++ 2% smaller. Noticeable improvements on other things like box2d etc.
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r--src/passes/pass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index be7365998..38a21fae8 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -197,6 +197,7 @@ static void dumpWast(Name name, Module* wasm) {
// write out the wast
static int counter = 0;
auto fullName = std::string("byn-") + std::to_string(counter++) + "-" + name.str + ".wasm";
+ Colors::disable();
ModuleWriter writer;
writer.setBinary(false); // TODO: add an option for binary
writer.write(*wasm, fullName);