summaryrefslogtreecommitdiff
path: root/src/passes/CodePushing.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-11-18 08:18:07 -0800
committerGitHub <noreply@github.com>2020-11-18 08:18:07 -0800
commite2e2a7decd45f1011cb1ebe703f075d5e09834b9 (patch)
tree113d155d7c47868ff2821877cf94f49fe1a222b9 /src/passes/CodePushing.cpp
parent8b559e82156db94dc846830faa76071e58fe7d43 (diff)
downloadbinaryen-e2e2a7decd45f1011cb1ebe703f075d5e09834b9.tar.gz
binaryen-e2e2a7decd45f1011cb1ebe703f075d5e09834b9.tar.bz2
binaryen-e2e2a7decd45f1011cb1ebe703f075d5e09834b9.zip
[effects.h] Make internals internal, forcing the external API to be safe. (#3385)
A user of EffectAnalyzer could call walk or visit, to walk the entire input or just visit the node without chlidren. But this was unsafe - we just exposed the Walker/Visitor API here, and did not ensure that users did the stuff in analyze which does a little stuff before and after. In fact Vacuum got this wrong. To avoid that, move all the internals to an internal class. The external API now only allows the caller to call walk or visit, and both are safe. The change here is mostly whitespace + adding parent. prefixes. This is NFC except for fixing possible Vacuum issues (which I am not sure could happen in practice or not).
Diffstat (limited to 'src/passes/CodePushing.cpp')
-rw-r--r--src/passes/CodePushing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passes/CodePushing.cpp b/src/passes/CodePushing.cpp
index 7af192838..55c955539 100644
--- a/src/passes/CodePushing.cpp
+++ b/src/passes/CodePushing.cpp
@@ -160,7 +160,7 @@ private:
firstPushable < pushPoint);
// everything that matters if you want to be pushed past the pushPoint
EffectAnalyzer cumulativeEffects(passOptions, features);
- cumulativeEffects.analyze(list[pushPoint]);
+ cumulativeEffects.walk(list[pushPoint]);
// it is ok to ignore the branching here, that is the crucial point of this
// opt
// TODO: it would be ok to ignore thrown exceptions here, if we know they
@@ -194,7 +194,7 @@ private:
}
} else {
// something that can't be pushed, so it might block further pushing
- cumulativeEffects.analyze(list[i]);
+ cumulativeEffects.walk(list[i]);
}
assert(i > 0);
i--;