summaryrefslogtreecommitdiff
path: root/src/ir/effects.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r--src/ir/effects.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h
index 3d71a8433..f9b6ca6fc 100644
--- a/src/ir/effects.h
+++ b/src/ir/effects.h
@@ -716,6 +716,20 @@ private:
}
};
+// Calculate effects only on the node itself (shallowly), and not on
+// children.
+class ShallowEffectAnalyzer : public EffectAnalyzer {
+public:
+ ShallowEffectAnalyzer(const PassOptions& passOptions,
+ FeatureSet features,
+ Expression* ast = nullptr)
+ : EffectAnalyzer(passOptions, features) {
+ if (ast) {
+ visit(ast);
+ }
+ }
+};
+
} // namespace wasm
#endif // wasm_ir_effects_h