diff options
author | jgravelle-google <jgravelle@google.com> | 2017-02-23 10:22:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 10:22:02 -0800 |
commit | 3ddf9405cf887c1e0e0034b364c453e7c31acf4c (patch) | |
tree | 1ec77b7058bbc960aadf5e0e8fad39676ea9b930 /src/passes/MergeBlocks.cpp | |
parent | 7e133b55c7babaabb83fc0f665b4a60022d4b8fb (diff) | |
download | binaryen-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/passes/MergeBlocks.cpp')
-rw-r--r-- | src/passes/MergeBlocks.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/MergeBlocks.cpp b/src/passes/MergeBlocks.cpp index f8d044212..494bf5a9e 100644 --- a/src/passes/MergeBlocks.cpp +++ b/src/passes/MergeBlocks.cpp @@ -70,7 +70,7 @@ namespace wasm { // Looks for reasons we can't remove the values from breaks to an origin // For example, if there is a switch targeting us, we can't do it - we can't remove the value from other targets -struct ProblemFinder : public ControlFlowWalker<ProblemFinder, Visitor<ProblemFinder>> { +struct ProblemFinder : public ControlFlowWalker<ProblemFinder> { Name origin; bool foundSwitch = false; // count br_ifs, and dropped br_ifs. if they don't match, then a br_if flow value is used, and we can't drop it @@ -112,7 +112,7 @@ struct ProblemFinder : public ControlFlowWalker<ProblemFinder, Visitor<ProblemFi // Drops values from breaks to an origin. // While doing so it can create new blocks, so optimize blocks as well. -struct BreakValueDropper : public ControlFlowWalker<BreakValueDropper, Visitor<BreakValueDropper>> { +struct BreakValueDropper : public ControlFlowWalker<BreakValueDropper> { Name origin; void visitBlock(Block* curr); @@ -203,7 +203,7 @@ void BreakValueDropper::visitBlock(Block* curr) { optimizeBlock(curr, getModule()); } -struct MergeBlocks : public WalkerPass<PostWalker<MergeBlocks, Visitor<MergeBlocks>>> { +struct MergeBlocks : public WalkerPass<PostWalker<MergeBlocks>> { bool isFunctionParallel() override { return true; } Pass* create() override { return new MergeBlocks; } |