From 112746116d18516917d83d89eb9d470c59a06488 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 5 Dec 2019 16:55:50 -0800 Subject: [PATCH] Include in minification all imports from modules starting with `wasi_` This allows us to support not just wasi_unstable but also the new wasi_snapshot_preview1 and beyond. See https://github.com/emscripten-core/emscripten/pull/9956 --- src/passes/MinifyImportsAndExports.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/passes/MinifyImportsAndExports.cpp b/src/passes/MinifyImportsAndExports.cpp index ec582a64e25..60dd2cd808b 100644 --- a/src/passes/MinifyImportsAndExports.cpp +++ b/src/passes/MinifyImportsAndExports.cpp @@ -41,8 +41,6 @@ namespace wasm { -static Name WASI_UNSTABLE("wasi_unstable"); - struct MinifyImportsAndExports : public Pass { bool minifyExports; @@ -162,7 +160,7 @@ struct MinifyImportsAndExports : public Pass { } }; auto processImport = [&](Importable* curr) { - if (curr->module == ENV || curr->module == WASI_UNSTABLE) { + if (curr->module == ENV || curr->module.startsWith("wasi_")) { process(curr->base); } };