summaryrefslogtreecommitdiff
path: root/src/tools/wasm-split/split-options.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-09-17 11:49:45 -0700
committerGitHub <noreply@github.com>2024-09-17 11:49:45 -0700
commitf9b64c8c5d9ad720304e101dc58790f3bbfdfc3c (patch)
tree0f0f319ed0d543a86712ec3fc0fe7877f0eacc8b /src/tools/wasm-split/split-options.cpp
parent0da6d3e5b729e1fe7cc608720dc3d428fefcdb03 (diff)
downloadbinaryen-f9b64c8c5d9ad720304e101dc58790f3bbfdfc3c.tar.gz
binaryen-f9b64c8c5d9ad720304e101dc58790f3bbfdfc3c.tar.bz2
binaryen-f9b64c8c5d9ad720304e101dc58790f3bbfdfc3c.zip
[wasm-split] Simplify handling of --keep-funcs and --split-funcs (#6948)
Maintain the invariant that every defined functions belongs to either the set of kept functions or the set of split functions. Functions are kept by default except when --keep-funcs is specified without --split-funcs on the command line. This is mostly NFC except that it changes the default behavior when no arguments are specified on the command line to keep all functions. This will simplify a follow-on PR that switches from passing the kept functions to the module splitting utility to passing the split functions.
Diffstat (limited to 'src/tools/wasm-split/split-options.cpp')
-rw-r--r--src/tools/wasm-split/split-options.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/wasm-split/split-options.cpp b/src/tools/wasm-split/split-options.cpp
index e77957f1f..cada7930b 100644
--- a/src/tools/wasm-split/split-options.cpp
+++ b/src/tools/wasm-split/split-options.cpp
@@ -147,6 +147,7 @@ WasmSplitOptions::WasmSplitOptions()
Options::Arguments::One,
[&](Options* o, const std::string& argument) {
keepFuncs = parseNameList(argument);
+ hasKeepFuncs = true;
})
.add("--split-funcs",
"",
@@ -160,6 +161,7 @@ WasmSplitOptions::WasmSplitOptions()
Options::Arguments::One,
[&](Options* o, const std::string& argument) {
splitFuncs = parseNameList(argument);
+ hasSplitFuncs = true;
})
.add(
"--manifest",