summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-12-13 18:50:13 -0800
committerGitHub <noreply@github.com>2019-12-13 18:50:13 -0800
commitd8830094801f92589fb498ce743f5e45532a1707 (patch)
treebef00542f41752e9b5211d87847f8eaa0857f104 /src
parent321222a26b8fcc3a284b52e5cedd4c3a5b734939 (diff)
downloadbinaryen-d8830094801f92589fb498ce743f5e45532a1707.tar.gz
binaryen-d8830094801f92589fb498ce743f5e45532a1707.tar.bz2
binaryen-d8830094801f92589fb498ce743f5e45532a1707.zip
Write wasm/wast files with BINARYEN_PASS_DEBUG=3 (#2527)
Currently `BINARYEN_PASS_DEBUG=3` prints `.wasm` files but they are actually text wast files. This makes `BINARYEN_PASS_DEBUG=3` prints both wasm/wast files, where wasm contains a binary file and wast a text file.
Diffstat (limited to 'src')
-rw-r--r--src/passes/pass.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index 5dd39a453..113017df5 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -468,11 +468,11 @@ static void dumpWast(Name name, Module* wasm) {
// TODO: use _getpid() on windows, elsewhere?
fullName += std::to_string(getpid()) + '-';
#endif
- fullName += numstr + "-" + name.str + ".wasm";
+ fullName += numstr + "-" + name.str;
Colors::setEnabled(false);
ModuleWriter writer;
- writer.setBinary(false); // TODO: add an option for binary
- writer.write(*wasm, fullName);
+ writer.writeText(*wasm, fullName + ".wast");
+ writer.writeBinary(*wasm, fullName + ".wasm");
}
void PassRunner::run() {