diff options
Diffstat (limited to 'src/passes/NoExitRuntime.cpp')
-rw-r--r-- | src/passes/NoExitRuntime.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/passes/NoExitRuntime.cpp b/src/passes/NoExitRuntime.cpp index 05dd639c9..680b91b23 100644 --- a/src/passes/NoExitRuntime.cpp +++ b/src/passes/NoExitRuntime.cpp @@ -20,10 +20,10 @@ // run. // +#include <asmjs/shared-constants.h> #include <pass.h> -#include <wasm.h> #include <wasm-builder.h> -#include <asmjs/shared-constants.h> +#include <wasm.h> using namespace std; @@ -34,27 +34,23 @@ struct NoExitRuntime : public WalkerPass<PostWalker<NoExitRuntime>> { Pass* create() override { return new NoExitRuntime; } - // Remove all possible manifestations of atexit, across asm2wasm and llvm wasm backend. - std::array<Name, 4> ATEXIT_NAMES = {{ "___cxa_atexit", - "__cxa_atexit", - "_atexit", - "atexit" }}; + // Remove all possible manifestations of atexit, across asm2wasm and llvm wasm + // backend. + std::array<Name, 4> ATEXIT_NAMES = { + {"___cxa_atexit", "__cxa_atexit", "_atexit", "atexit"}}; void visitCall(Call* curr) { auto* import = getModule()->getFunctionOrNull(curr->target); - if (!import || !import->imported() || import->module != ENV) return; + if (!import || !import->imported() || import->module != ENV) + return; for (auto name : ATEXIT_NAMES) { if (name == import->base) { - replaceCurrent( - Builder(*getModule()).replaceWithIdenticalType(curr) - ); + replaceCurrent(Builder(*getModule()).replaceWithIdenticalType(curr)); } } } }; -Pass* createNoExitRuntimePass() { - return new NoExitRuntime(); -} +Pass* createNoExitRuntimePass() { return new NoExitRuntime(); } } // namespace wasm |