diff options
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index ad8f68efa..ee45d8205 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -17,6 +17,7 @@ #ifndef wasm_ir_effects_h #define wasm_ir_effects_h +#include "ir/intrinsics.h" #include "pass.h" #include "wasm-traversal.h" @@ -31,7 +32,7 @@ public: Expression* ast = nullptr) : ignoreImplicitTraps(passOptions.ignoreImplicitTraps), trapsNeverHappen(passOptions.trapsNeverHappen), - debugInfo(passOptions.debugInfo), module(&module), + debugInfo(passOptions.debugInfo), module(module), features(module.features) { if (ast) { walk(ast); @@ -41,7 +42,7 @@ public: bool ignoreImplicitTraps; bool trapsNeverHappen; bool debugInfo; - Module* module; + Module& module; FeatureSet features; // Walk an expression and all its children. @@ -393,6 +394,11 @@ private: } void visitCall(Call* curr) { + // call.without.effects has no effects. + if (Intrinsics(parent.module).isCallWithoutEffects(curr)) { + return; + } + parent.calls = true; // When EH is enabled, any call can throw. if (parent.features.hasExceptionHandling() && parent.tryDepth == 0) { |