summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-04-11 15:57:05 -0700
committerGitHub <noreply@github.com>2019-04-11 15:57:05 -0700
commitfc3b8eed2b9fb2aa7e55ac833ea08cf7eae46a0a (patch)
tree2a8787a3143c2c437905fc9533c7575cb03604a1 /src/tools
parentb769b4ede65eb014376b67f78ba5e6cb04e0cef8 (diff)
downloadbinaryen-fc3b8eed2b9fb2aa7e55ac833ea08cf7eae46a0a.tar.gz
binaryen-fc3b8eed2b9fb2aa7e55ac833ea08cf7eae46a0a.tar.bz2
binaryen-fc3b8eed2b9fb2aa7e55ac833ea08cf7eae46a0a.zip
wasm2js: emscripten glue option (#2000)
Add a wasm2js option for the glue to be in emscripten-compatible format (as opposed to ES6). This does a few things so far: * Emit START_FUNCTIONS, END_FUNCTIONS markers in the code, for future use in the optimizer. * Emit the glue as a function to be called from emscripten.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/wasm2js.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/wasm2js.cpp b/src/tools/wasm2js.cpp
index 76a724f86..8704dbf49 100644
--- a/src/tools/wasm2js.cpp
+++ b/src/tools/wasm2js.cpp
@@ -370,6 +370,11 @@ int main(int argc, const char *argv[]) {
[&](Options* o, const std::string& argument) {
flags.pedantic = true;
})
+ .add("--emscripten", "", "Emulate the glue in emscripten-compatible form (and not ES6 module form)",
+ Options::Arguments::Zero,
+ [&](Options* o, const std::string& argument) {
+ flags.emscripten = true;
+ })
.add_positional("INFILE", Options::Arguments::One,
[](Options *o, const std::string& argument) {
o->extra["infile"] = argument;