diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2021-05-25 15:32:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-25 15:32:39 -0700 |
commit | 7f31823120ba25075d783df863f6be536543f805 (patch) | |
tree | 715631368260ecda006f65c9c07433294aed26d1 /src/wasm/wasm-io.cpp | |
parent | 994757a6747793effc8e4bdda13c47ab7337afb8 (diff) | |
download | binaryen-7f31823120ba25075d783df863f6be536543f805.tar.gz binaryen-7f31823120ba25075d783df863f6be536543f805.tar.bz2 binaryen-7f31823120ba25075d783df863f6be536543f805.zip |
[wasm-split] Add an option to emit only the module names (#3901)
Even when other names are stripped, it can be useful for wasm-split to preserve
the module name so that the split modules can be differentiated in stack traces.
Adding this option to wasm-split requires adding similar options to ModuleWriter
and WasmBinaryWriter.
Diffstat (limited to 'src/wasm/wasm-io.cpp')
-rw-r--r-- | src/wasm/wasm-io.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm/wasm-io.cpp b/src/wasm/wasm-io.cpp index 42eb9ab46..795bf40a5 100644 --- a/src/wasm/wasm-io.cpp +++ b/src/wasm/wasm-io.cpp @@ -137,6 +137,9 @@ void ModuleWriter::writeBinary(Module& wasm, Output& output) { WasmBinaryWriter writer(&wasm, buffer); // if debug info is used, then we want to emit the names section writer.setNamesSection(debugInfo); + if (emitModuleName) { + writer.setEmitModuleName(true); + } std::unique_ptr<std::ofstream> sourceMapStream; if (sourceMapFilename.size()) { sourceMapStream = make_unique<std::ofstream>(); |