summaryrefslogtreecommitdiff
path: root/src/passes/ExtractFunction.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-10-06 16:41:13 -0700
committerGitHub <noreply@github.com>2023-10-06 16:41:13 -0700
commitb3775b5e4e150439276ad3d34f1bb564b28e8ef5 (patch)
treeeb7b09492205249f08459ffee38e081b83cbf17d /src/passes/ExtractFunction.cpp
parent9c1107d17c0b7223bd377d9ab4f36fe54ef07c7d (diff)
downloadbinaryen-b3775b5e4e150439276ad3d34f1bb564b28e8ef5.tar.gz
binaryen-b3775b5e4e150439276ad3d34f1bb564b28e8ef5.tar.bz2
binaryen-b3775b5e4e150439276ad3d34f1bb564b28e8ef5.zip
Automatically discard global effects in the rare passes that add effects (#5999)
All logging/instrumentation passes need to do this, to avoid us using stale global effects that are too low (too high is not optimal either, but at least it cannot cause bugs).
Diffstat (limited to 'src/passes/ExtractFunction.cpp')
-rw-r--r--src/passes/ExtractFunction.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/passes/ExtractFunction.cpp b/src/passes/ExtractFunction.cpp
index e3f2a5538..440468ede 100644
--- a/src/passes/ExtractFunction.cpp
+++ b/src/passes/ExtractFunction.cpp
@@ -58,6 +58,9 @@ static void extract(PassRunner* runner, Module* module, Name name) {
}
struct ExtractFunction : public Pass {
+ // Turns functions into imported functions.
+ bool addsEffects() override { return true; }
+
void run(Module* module) override {
Name name = getPassOptions().getArgument(
"extract-function",
@@ -67,6 +70,9 @@ struct ExtractFunction : public Pass {
};
struct ExtractFunctionIndex : public Pass {
+ // See above.
+ bool addsEffects() override { return true; }
+
void run(Module* module) override {
std::string index =
getPassOptions().getArgument("extract-function-index",