From 7f31823120ba25075d783df863f6be536543f805 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 25 May 2021 15:32:39 -0700 Subject: [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. --- src/wasm/wasm-io.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/wasm/wasm-io.cpp') 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 sourceMapStream; if (sourceMapFilename.size()) { sourceMapStream = make_unique(); -- cgit v1.2.3