From f9b64c8c5d9ad720304e101dc58790f3bbfdfc3c Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 17 Sep 2024 11:49:45 -0700 Subject: [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. --- src/tools/wasm-split/split-options.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools/wasm-split/split-options.cpp') 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", -- cgit v1.2.3