diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-11-07 10:20:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 10:20:42 -0800 |
commit | 89d393ed02f6b15a3a8dc60b489f969184070625 (patch) | |
tree | 01b3e429c5afb8794c972c27276385345f53e8b8 /src/passes/ExtractFunction.cpp | |
parent | 033b5e161e677173bda01aad9e6850545b93c97e (diff) | |
parent | 4a3892d31288bded757e3805cb53d4e20ccc6be0 (diff) | |
download | binaryen-89d393ed02f6b15a3a8dc60b489f969184070625.tar.gz binaryen-89d393ed02f6b15a3a8dc60b489f969184070625.tar.bz2 binaryen-89d393ed02f6b15a3a8dc60b489f969184070625.zip |
Merge pull request #827 from WebAssembly/relooper
Reloop if-loops with label targets
Diffstat (limited to 'src/passes/ExtractFunction.cpp')
-rw-r--r-- | src/passes/ExtractFunction.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/passes/ExtractFunction.cpp b/src/passes/ExtractFunction.cpp index b342efc3b..b91d2c406 100644 --- a/src/passes/ExtractFunction.cpp +++ b/src/passes/ExtractFunction.cpp @@ -23,12 +23,18 @@ namespace wasm { -Name TO_LEAVE("_bytearray_join"); // TODO: commandline param struct ExtractFunction : public Pass { void run(PassRunner* runner, Module* module) override { + auto* leave = getenv("BYN_LEAVE"); + if (!leave) { + std::cerr << "usage: set BYN_LEAVE in the env\n"; + abort(); + } + Name LEAVE(leave); + std::cerr << "keeping " << LEAVE << "\n"; for (auto& func : module->functions) { - if (func->name != TO_LEAVE) { + if (func->name != LEAVE) { // wipe out the body func->body = module->allocator.alloc<Unreachable>(); } |