summaryrefslogtreecommitdiff
path: root/src/passes/JSPI.cpp
diff options
context:
space:
mode:
authorChristian Speckner <christian.speckner@mayflower.de>2024-07-16 01:04:37 +0200
committerGitHub <noreply@github.com>2024-07-15 16:04:37 -0700
commitfd8b2bd43d73cf1976426e60c22c5261fa343510 (patch)
tree79d1fbc91d65ba0f8a4a6b3db0ca070b0628ebda /src/passes/JSPI.cpp
parentaec516f1259c3fec92982db92dc0e4e67ab2251a (diff)
downloadbinaryen-fd8b2bd43d73cf1976426e60c22c5261fa343510.tar.gz
binaryen-fd8b2bd43d73cf1976426e60c22c5261fa343510.tar.bz2
binaryen-fd8b2bd43d73cf1976426e60c22c5261fa343510.zip
Allow different arguments for multiple instances of a pass (#6687)
Each pass instance can now store an argument for it, which can be different. This may be a breaking change for the corner case of running a pass multiple times and setting the pass's argument multiple times as well (before, the last pass argument affected them all; now, it affects the last instance only). This only affects arguments with the name of a pass; others remain global, as before (and multiple passes can read them, in fact). See the CHANGELOG for details. Fixes #6646
Diffstat (limited to 'src/passes/JSPI.cpp')
-rw-r--r--src/passes/JSPI.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/passes/JSPI.cpp b/src/passes/JSPI.cpp
index 1adf0de4c..d5fed1faf 100644
--- a/src/passes/JSPI.cpp
+++ b/src/passes/JSPI.cpp
@@ -83,18 +83,17 @@ struct JSPI : public Pass {
void run(Module* module) override {
Builder builder(*module);
- auto& options = getPassOptions();
// Find which imports can suspend.
- auto stateChangingImports = String::trim(read_possible_response_file(
- options.getArgumentOrDefault("jspi-imports", "")));
+ auto stateChangingImports = String::trim(
+ read_possible_response_file(getArgumentOrDefault("jspi-imports", "")));
String::Split listedImports(stateChangingImports, ",");
// Find which exports should create a promise.
- auto stateChangingExports = String::trim(read_possible_response_file(
- options.getArgumentOrDefault("jspi-exports", "")));
+ auto stateChangingExports = String::trim(
+ read_possible_response_file(getArgumentOrDefault("jspi-exports", "")));
String::Split listedExports(stateChangingExports, ",");
- bool wasmSplit = options.hasArgument("jspi-split-module");
+ bool wasmSplit = hasArgument("jspi-split-module");
if (wasmSplit) {
// Make an import for the load secondary module function so a JSPI wrapper
// version will be created.