File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,17 @@ struct NoExitRuntime : public WalkerPass<PostWalker<NoExitRuntime>> {
3434
3535 Pass* create () override { return new NoExitRuntime; }
3636
37+ // Remove all possible manifestations of atexit, across asm2wasm and llvm wasm backend.
38+ std::array<Name, 4 > ATEXIT_NAMES = {{ " ___cxa_atexit" ,
39+ " __cxa_atexit" ,
40+ " _atexit" ,
41+ " atexit" }};
42+
3743 void visitCall (Call* curr) {
3844 auto * import = getModule ()->getFunctionOrNull (curr->target );
3945 if (!import || !import ->imported () || import ->module != ENV) return ;
40- // Remove all possible manifestations of atexit, across asm2wasm and llvm wasm backend.
41- for (auto * name : {
42- " ___cxa_atexit" ,
43- " _atexit" ,
44- " __cxa_atexit" ,
45- " atexit" ,
46- }) {
47- if (strcmp (name, import ->base .str ) == 0 ) {
46+ for (auto name : ATEXIT_NAMES) {
47+ if (name == import ->base ) {
4848 replaceCurrent (
4949 Builder (*getModule ()).replaceWithIdenticalType (curr)
5050 );
You can’t perform that action at this time.
0 commit comments