summaryrefslogtreecommitdiff
path: root/src/tools/wasm-as.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-06-13 16:05:01 -0700
committerGitHub <noreply@github.com>2017-06-13 16:05:01 -0700
commitb5b40c9ab0c35ed74e97a6491e15651382091b2e (patch)
treed2ec6c2006089d8385b850a730af4be936874314 /src/tools/wasm-as.cpp
parent61b409bc845f385f1d7ea7ac81d1649b63435828 (diff)
downloadbinaryen-b5b40c9ab0c35ed74e97a6491e15651382091b2e.tar.gz
binaryen-b5b40c9ab0c35ed74e97a6491e15651382091b2e.tar.bz2
binaryen-b5b40c9ab0c35ed74e97a6491e15651382091b2e.zip
SSA pass (#1049)
* Add SSA pass which ensures a single assign for each local, except for merged locals where we ensure exactly a single assign from one of the paths leading to that use * Also add InstrumentLocals pass, useful for debugging locals (similar to InstrumentMemory but for locals) * Fix a PickLoadSigns bug with tees not being ignored, which was not noticed until now because we ran it on flatter output by default, but the ssa pass uncovered the bug
Diffstat (limited to 'src/tools/wasm-as.cpp')
-rw-r--r--src/tools/wasm-as.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/wasm-as.cpp b/src/tools/wasm-as.cpp
index e8003a5ca..d4b495562 100644
--- a/src/tools/wasm-as.cpp
+++ b/src/tools/wasm-as.cpp
@@ -24,6 +24,8 @@
#include "wasm-binary.h"
#include "wasm-s-parser.h"
+#include "tool-utils.h"
+
using namespace cashew;
using namespace wasm;
@@ -68,6 +70,11 @@ int main(int argc, const char *argv[]) {
});
options.parse(argc, argv);
+ // default output is infile with changed suffix
+ if (options.extra.find("output") == options.extra.end()) {
+ options.extra["output"] = removeSpecificSuffix(options.extra["infile"], ".wast") + ".wasm";
+ }
+
auto input(read_file<std::string>(options.extra["infile"], Flags::Text, options.debug ? Flags::Debug : Flags::Release));
Module wasm;