diff options
author | Alon Zakai <azakai@google.com> | 2020-09-02 11:54:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 11:54:54 -0700 |
commit | 7438b6cbcb9b194db59c0e5c497208ce57c964a9 (patch) | |
tree | 3a2fcff10e3cb8c4ff3738000c1adba25f42ba2a /src/ir/module-utils.h | |
parent | 89020a0b4074d18c3fedd0aec2b2aa900c538a1d (diff) | |
download | binaryen-7438b6cbcb9b194db59c0e5c497208ce57c964a9.tar.gz binaryen-7438b6cbcb9b194db59c0e5c497208ce57c964a9.tar.bz2 binaryen-7438b6cbcb9b194db59c0e5c497208ce57c964a9.zip |
MinifyImportsAndExports: Minify the memory and table as well. (#3089)
We were careful not to minify those, as well as the stack pointer, which
makes sense in dynamic linking. But we don't run this pass in dynamic linking
anyhow - we need the proper names of symbols in that case. So this was
not helping us, and was just a leftover from an early state.
This both a useful optimization and also important for #3043,
as the wasm backend exports the table as __indirect_function_table - a much
longer name than emscripten's table. So just changing to that would regress
code size on small projects. Once we land this, the name won't matter as it will
be minified anyhow.
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r-- | src/ir/module-utils.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index 375d9e245..62a9dd921 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -229,6 +229,14 @@ template<typename T> inline void iterDefinedEvents(Module& wasm, T visitor) { } } +template<typename T> inline void iterImports(Module& wasm, T visitor) { + iterImportedMemories(wasm, visitor); + iterImportedTables(wasm, visitor); + iterImportedGlobals(wasm, visitor); + iterImportedFunctions(wasm, visitor); + iterImportedEvents(wasm, visitor); +} + // Helper class for performing an operation on all the functions in the module, // in parallel, with an Info object for each one that can contain results of // some computation that the operation performs. |