summaryrefslogtreecommitdiff
path: root/src/ast_utils.h
diff options
context:
space:
mode:
authorjgravelle-google <jgravelle@google.com>2017-02-23 10:22:02 -0800
committerGitHub <noreply@github.com>2017-02-23 10:22:02 -0800
commit3ddf9405cf887c1e0e0034b364c453e7c31acf4c (patch)
tree1ec77b7058bbc960aadf5e0e8fad39676ea9b930 /src/ast_utils.h
parent7e133b55c7babaabb83fc0f665b4a60022d4b8fb (diff)
downloadbinaryen-3ddf9405cf887c1e0e0034b364c453e7c31acf4c.tar.gz
binaryen-3ddf9405cf887c1e0e0034b364c453e7c31acf4c.tar.bz2
binaryen-3ddf9405cf887c1e0e0034b364c453e7c31acf4c.zip
Default Walker subclasses to using Visitor<SubType> (#921)
Most module walkers use PostWalker<T, Visitor<T>>, let that pattern be expressed as simply PostWalker<T>
Diffstat (limited to 'src/ast_utils.h')
-rw-r--r--src/ast_utils.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ast_utils.h b/src/ast_utils.h
index 35ad96987..00b755bf7 100644
--- a/src/ast_utils.h
+++ b/src/ast_utils.h
@@ -27,7 +27,7 @@ namespace wasm {
// Finds if there are breaks targeting a name. Note that since names are
// unique in our IR, we just need to look for the name, and do not need
// to analyze scoping.
-struct BreakSeeker : public PostWalker<BreakSeeker, Visitor<BreakSeeker>> {
+struct BreakSeeker : public PostWalker<BreakSeeker> {
Name target;
Index found;
WasmType valueType;
@@ -70,7 +70,7 @@ struct BreakSeeker : public PostWalker<BreakSeeker, Visitor<BreakSeeker>> {
// Look for side effects, including control flow
// TODO: optimize
-struct EffectAnalyzer : public PostWalker<EffectAnalyzer, Visitor<EffectAnalyzer>> {
+struct EffectAnalyzer : public PostWalker<EffectAnalyzer> {
EffectAnalyzer(PassOptions& passOptions, Expression *ast = nullptr) {
ignoreImplicitTraps = passOptions.ignoreImplicitTraps;
if (ast) analyze(ast);
@@ -350,7 +350,7 @@ struct ExpressionAnalyzer {
// Finalizes a node
-struct ReFinalize : public WalkerPass<PostWalker<ReFinalize, Visitor<ReFinalize>>> {
+struct ReFinalize : public WalkerPass<PostWalker<ReFinalize>> {
ReFinalize() { name = "refinalize"; }
void visitBlock(Block *curr) { curr->finalize(); }
@@ -380,7 +380,7 @@ struct ReFinalize : public WalkerPass<PostWalker<ReFinalize, Visitor<ReFinalize>
// Adds drop() operations where necessary. This lets you not worry about adding drop when
// generating code.
-struct AutoDrop : public WalkerPass<ExpressionStackWalker<AutoDrop, Visitor<AutoDrop>>> {
+struct AutoDrop : public WalkerPass<ExpressionStackWalker<AutoDrop>> {
bool isFunctionParallel() override { return true; }
Pass* create() override { return new AutoDrop; }