summaryrefslogtreecommitdiff
path: root/src/tools/wasm-split
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-split')
-rw-r--r--src/tools/wasm-split/split-options.cpp9
-rw-r--r--src/tools/wasm-split/split-options.h1
-rw-r--r--src/tools/wasm-split/wasm-split.cpp1
3 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/wasm-split/split-options.cpp b/src/tools/wasm-split/split-options.cpp
index 9a9351998..825efddd9 100644
--- a/src/tools/wasm-split/split-options.cpp
+++ b/src/tools/wasm-split/split-options.cpp
@@ -177,6 +177,15 @@ WasmSplitOptions::WasmSplitOptions()
Options::Arguments::Zero,
[&](Options* o, const std::string& argument) { symbolMap = true; })
.add(
+ "--no-placeholders",
+ "",
+ "Do not import placeholder functions. Calls to secondary functions will "
+ "fail before the secondary module has been instantiated.",
+ WasmSplitOption,
+ {Mode::Split},
+ Options::Arguments::Zero,
+ [&](Options* o, const std::string& argument) { usePlaceholders = false; })
+ .add(
"--placeholdermap",
"",
"Write a file mapping placeholder indices to the function names.",
diff --git a/src/tools/wasm-split/split-options.h b/src/tools/wasm-split/split-options.h
index 6aa5b0011..b8129f29b 100644
--- a/src/tools/wasm-split/split-options.h
+++ b/src/tools/wasm-split/split-options.h
@@ -41,6 +41,7 @@ struct WasmSplitOptions : ToolOptions {
};
StorageKind storageKind = StorageKind::InGlobals;
+ bool usePlaceholders = true;
bool unescape = false;
bool verbose = false;
bool emitBinary = true;
diff --git a/src/tools/wasm-split/wasm-split.cpp b/src/tools/wasm-split/wasm-split.cpp
index c1ec6052f..cb148090d 100644
--- a/src/tools/wasm-split/wasm-split.cpp
+++ b/src/tools/wasm-split/wasm-split.cpp
@@ -329,6 +329,7 @@ void splitModule(const WasmSplitOptions& options) {
if (options.exportPrefix.size()) {
config.newExportPrefix = options.exportPrefix;
}
+ config.usePlaceholders = options.usePlaceholders;
config.minimizeNewExportNames = !options.passOptions.debugInfo;
config.jspi = options.jspi;
auto splitResults = ModuleSplitting::splitFunctions(wasm, config);