diff options
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>(); } |