summaryrefslogtreecommitdiff
path: root/src/ir/local-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/local-utils.h')
-rw-r--r--src/ir/local-utils.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/ir/local-utils.h b/src/ir/local-utils.h
index 0eba31889..73d065e73 100644
--- a/src/ir/local-utils.h
+++ b/src/ir/local-utils.h
@@ -45,23 +45,21 @@ struct UnneededSetRemover : public PostWalker<UnneededSetRemover> {
PassOptions& passOptions;
LocalGetCounter* localGetCounter = nullptr;
- FeatureSet features;
+ Module& module;
- UnneededSetRemover(Function* func,
- PassOptions& passOptions,
- FeatureSet features)
- : passOptions(passOptions), features(features) {
+ UnneededSetRemover(Function* func, PassOptions& passOptions, Module& module)
+ : passOptions(passOptions), module(module) {
LocalGetCounter counter(func);
- UnneededSetRemover inner(counter, func, passOptions, features);
+ UnneededSetRemover inner(counter, func, passOptions, module);
removed = inner.removed;
}
UnneededSetRemover(LocalGetCounter& localGetCounter,
Function* func,
PassOptions& passOptions,
- FeatureSet features)
+ Module& module)
: passOptions(passOptions), localGetCounter(&localGetCounter),
- features(features) {
+ module(module) {
walk(func->body);
}
@@ -96,7 +94,7 @@ struct UnneededSetRemover : public PostWalker<UnneededSetRemover> {
auto* value = set->value;
if (set->isTee()) {
replaceCurrent(value);
- } else if (EffectAnalyzer(passOptions, features, set->value)
+ } else if (EffectAnalyzer(passOptions, module, set->value)
.hasSideEffects()) {
Drop* drop = ExpressionManipulator::convert<LocalSet, Drop>(set);
drop->value = value;