diff options
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index 77b8f1a93..ee0459d7d 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -79,10 +79,8 @@ struct SimplifyLocals Expression** item; EffectAnalyzer effects; - SinkableInfo(Expression** item, - PassOptions& passOptions, - FeatureSet features) - : item(item), effects(passOptions, features, *item) {} + SinkableInfo(Expression** item, PassOptions& passOptions, Module& module) + : item(item), effects(passOptions, module, *item) {} }; // a list of sinkables in a linear execution trace @@ -315,7 +313,7 @@ struct SimplifyLocals } } - EffectAnalyzer effects(self->getPassOptions(), self->getModule()->features); + EffectAnalyzer effects(self->getPassOptions(), *self->getModule()); if (effects.checkPre(curr)) { self->checkInvalidations(effects); } @@ -401,8 +399,7 @@ struct SimplifyLocals } } - FeatureSet features = self->getModule()->features; - EffectAnalyzer effects(self->getPassOptions(), features); + EffectAnalyzer effects(self->getPassOptions(), *self->getModule()); if (effects.checkPost(original)) { self->checkInvalidations(effects); } @@ -411,7 +408,8 @@ struct SimplifyLocals Index index = set->index; assert(self->sinkables.count(index) == 0); self->sinkables.emplace(std::make_pair( - index, SinkableInfo(currp, self->getPassOptions(), features))); + index, + SinkableInfo(currp, self->getPassOptions(), *self->getModule()))); } if (!allowNesting) { @@ -428,7 +426,7 @@ struct SimplifyLocals // 'catch', because 'pop' should follow right after 'catch'. FeatureSet features = this->getModule()->features; if (features.hasExceptionHandling() && - EffectAnalyzer(this->getPassOptions(), features, set->value) + EffectAnalyzer(this->getPassOptions(), *this->getModule(), set->value) .danglingPop) { return false; } @@ -530,7 +528,6 @@ struct SimplifyLocals // ) // ) // so we must check for that. - FeatureSet features = this->getModule()->features; for (size_t j = 0; j < breaks.size(); j++) { // move break local.set's value to the break auto* breakLocalSetPointer = breaks[j].sinkables.at(sharedIndex).item; @@ -548,8 +545,9 @@ struct SimplifyLocals Nop nop; *breakLocalSetPointer = &nop; EffectAnalyzer condition( - this->getPassOptions(), features, br->condition); - EffectAnalyzer value(this->getPassOptions(), features, set); + this->getPassOptions(), *this->getModule(), br->condition); + EffectAnalyzer value( + this->getPassOptions(), *this->getModule(), set); *breakLocalSetPointer = set; if (condition.invalidates(value)) { // indeed, we can't do this, stop |