diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/GlobalEffects.cpp | 13 | ||||
-rw-r--r-- | src/passes/Vacuum.cpp | 2 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/passes/GlobalEffects.cpp b/src/passes/GlobalEffects.cpp index 1dd91e5d7..2f816a0bd 100644 --- a/src/passes/GlobalEffects.cpp +++ b/src/passes/GlobalEffects.cpp @@ -49,8 +49,8 @@ struct GenerateGlobalEffects : public Pass { } // Gather the effects. - auto effects = std::make_unique<EffectAnalyzer>( - runner->options, *module, func->body); + auto effects = + std::make_unique<EffectAnalyzer>(runner->options, *module, func); // If the body has a call, give up - that means we can't infer a more // specific set of effects than the pessimistic case of just assuming @@ -60,15 +60,6 @@ struct GenerateGlobalEffects : public Pass { return; } - // We can ignore branching out of the function body - this can only be - // a return, and that is only noticeable in the function, not outside. - effects->branchesOut = false; - - // Ignore local effects - when the function exits, those become - // unnoticeable anyhow. - effects->localsWritten.clear(); - effects->localsRead.clear(); - // Save the useful effects we found. storedEffects = std::move(effects); }); diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index 208e973da..a29c74a89 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -390,7 +390,7 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> { ExpressionManipulator::nop(curr->body); } if (curr->getResults() == Type::none && - !EffectAnalyzer(getPassOptions(), *getModule(), curr->body) + !EffectAnalyzer(getPassOptions(), *getModule(), curr) .hasUnremovableSideEffects()) { ExpressionManipulator::nop(curr->body); } |