summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pass.h3
-rw-r--r--src/passes/CoalesceLocals.cpp2
-rw-r--r--src/passes/CodeFolding.cpp2
-rw-r--r--src/passes/DeadCodeElimination.cpp4
-rw-r--r--src/passes/LocalCSE.cpp2
-rw-r--r--src/passes/OptimizeInstructions.cpp2
-rw-r--r--src/passes/Precompute.cpp2
-rw-r--r--src/passes/RelooperJumpThreading.cpp2
-rw-r--r--src/passes/RemoveUnusedBrs.cpp4
-rw-r--r--src/passes/SimplifyLocals.cpp4
-rw-r--r--src/passes/TrapMode.cpp2
-rw-r--r--src/passes/Vacuum.cpp2
12 files changed, 17 insertions, 14 deletions
diff --git a/src/pass.h b/src/pass.h
index 2f3bca078..1c37bea40 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -213,6 +213,9 @@ template <typename WalkerType>
class WalkerPass : public Pass, public WalkerType {
PassRunner *runner;
+protected:
+ typedef WalkerPass<WalkerType> super;
+
public:
void run(PassRunner* runner, Module* module) override {
setPassRunner(runner);
diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp
index 5ab68da23..af25f3fbe 100644
--- a/src/passes/CoalesceLocals.cpp
+++ b/src/passes/CoalesceLocals.cpp
@@ -271,7 +271,7 @@ void CoalesceLocals::doWalkFunction(Function* func) {
totalCopies.resize(numLocals);
std::fill(totalCopies.begin(), totalCopies.end(), 0);
// collect initial liveness info
- WalkerPass<CFGWalker<CoalesceLocals, Visitor<CoalesceLocals>, Liveness>>::doWalkFunction(func);
+ super::doWalkFunction(func);
// ignore links to dead blocks, so they don't confuse us and we can see their stores are all ineffective
liveBlocks = findLiveBlocks();
unlinkDeadBlocks(liveBlocks);
diff --git a/src/passes/CodeFolding.cpp b/src/passes/CodeFolding.cpp
index 047eee452..105232676 100644
--- a/src/passes/CodeFolding.cpp
+++ b/src/passes/CodeFolding.cpp
@@ -221,7 +221,7 @@ struct CodeFolding : public WalkerPass<ControlFlowWalker<CodeFolding>> {
anotherPass = true;
while (anotherPass) {
anotherPass = false;
- WalkerPass<ControlFlowWalker<CodeFolding>>::doWalkFunction(func);
+ super::doWalkFunction(func);
optimizeTerminatingTails(unreachableTails);
// optimize returns at the end, so we can benefit from a fallthrough if there is a value TODO: separate passes for them?
optimizeTerminatingTails(returnTails);
diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp
index bca898e25..e5673a0cc 100644
--- a/src/passes/DeadCodeElimination.cpp
+++ b/src/passes/DeadCodeElimination.cpp
@@ -49,7 +49,7 @@ struct DeadCodeElimination : public WalkerPass<PostWalker<DeadCodeElimination>>
Expression* replaceCurrent(Expression* expression) {
auto* old = getCurrent();
if (old == expression) return expression;
- WalkerPass<PostWalker<DeadCodeElimination>>::replaceCurrent(expression);
+ super::replaceCurrent(expression);
// also update the type updater
typeUpdater.noteReplacement(old, expression);
return expression;
@@ -270,7 +270,7 @@ struct DeadCodeElimination : public WalkerPass<PostWalker<DeadCodeElimination>>
self->pushTask(DeadCodeElimination::doAfterIfCondition, currp);
self->pushTask(DeadCodeElimination::scan, &curr->cast<If>()->condition);
} else {
- WalkerPass<PostWalker<DeadCodeElimination>>::scan(self, currp);
+ super::scan(self, currp);
}
}
diff --git a/src/passes/LocalCSE.cpp b/src/passes/LocalCSE.cpp
index a3e0dff76..609caf43a 100644
--- a/src/passes/LocalCSE.cpp
+++ b/src/passes/LocalCSE.cpp
@@ -109,7 +109,7 @@ struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> {
static void scan(LocalCSE* self, Expression** currp) {
self->pushTask(visitPost, currp);
- WalkerPass<LinearExecutionWalker<LocalCSE>>::scan(self, currp);
+ super::scan(self, currp);
self->pushTask(visitPre, currp);
}
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index b59b41b6a..27b573c0d 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -364,7 +364,7 @@ struct OptimizeInstructions : public WalkerPass<PostWalker<OptimizeInstructions,
scanner.walkFunction(func);
}
// main walk
- WalkerPass<PostWalker<OptimizeInstructions, UnifiedExpressionVisitor<OptimizeInstructions>>>::doWalkFunction(func);
+ super::doWalkFunction(func);
}
void visitExpression(Expression* curr) {
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index 72292c730..ab114fa14 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -117,7 +117,7 @@ struct Precompute : public WalkerPass<PostWalker<Precompute, UnifiedExpressionVi
optimizeLocals(func, getModule());
}
// do the main and final walk over everything
- WalkerPass<PostWalker<Precompute, UnifiedExpressionVisitor<Precompute>>>::doWalkFunction(func);
+ super::doWalkFunction(func);
}
void visitExpression(Expression* curr) {
diff --git a/src/passes/RelooperJumpThreading.cpp b/src/passes/RelooperJumpThreading.cpp
index 3656b5523..ad7582fb4 100644
--- a/src/passes/RelooperJumpThreading.cpp
+++ b/src/passes/RelooperJumpThreading.cpp
@@ -145,7 +145,7 @@ struct RelooperJumpThreading : public WalkerPass<ExpressionStackWalker<RelooperJ
labelIndex = func->getLocalIndex(LABEL);
LabelUseFinder finder(labelIndex, labelChecks, labelSets);
finder.walk(func->body);
- WalkerPass<ExpressionStackWalker<RelooperJumpThreading>>::doWalkFunction(func);
+ super::doWalkFunction(func);
}
}
diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp
index 7e122b806..7903534b6 100644
--- a/src/passes/RemoveUnusedBrs.cpp
+++ b/src/passes/RemoveUnusedBrs.cpp
@@ -207,7 +207,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> {
self->pushTask(clear, currp); // clear all flow after the condition
self->pushTask(scan, &iff->condition);
} else {
- WalkerPass<PostWalker<RemoveUnusedBrs>>::scan(self, currp);
+ super::scan(self, currp);
}
}
@@ -343,7 +343,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> {
bool worked = false;
do {
anotherCycle = false;
- WalkerPass<PostWalker<RemoveUnusedBrs>>::doWalkFunction(func);
+ super::doWalkFunction(func);
assert(ifStack.empty());
// flows may contain returns, which are flowing out and so can be optimized
for (size_t i = 0; i < flows.size(); i++) {
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp
index 618f8dead..cc74220df 100644
--- a/src/passes/SimplifyLocals.cpp
+++ b/src/passes/SimplifyLocals.cpp
@@ -432,7 +432,7 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals>>
self->pushTask(SimplifyLocals::doNoteIfElseCondition, currp);
self->pushTask(SimplifyLocals::scan, &curr->cast<If>()->condition);
} else {
- WalkerPass<LinearExecutionWalker<SimplifyLocals>>::scan(self, currp);
+ super::scan(self, currp);
}
self->pushTask(visitPre, currp);
@@ -454,7 +454,7 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals>>
do {
anotherCycle = false;
// main operation
- WalkerPass<LinearExecutionWalker<SimplifyLocals>>::doWalkFunction(func);
+ super::doWalkFunction(func);
// enlarge blocks that were marked, for the next round
if (blocksToEnlarge.size() > 0) {
for (auto* block : blocksToEnlarge) {
diff --git a/src/passes/TrapMode.cpp b/src/passes/TrapMode.cpp
index e648f66a5..2cb7b2f6b 100644
--- a/src/passes/TrapMode.cpp
+++ b/src/passes/TrapMode.cpp
@@ -297,7 +297,7 @@ public:
void doWalkModule(Module* module) {
trappingFunctions = make_unique<TrappingFunctionContainer>(mode, *module);
- WalkerPass<PostWalker<TrapModePass>>::doWalkModule(module);
+ super::doWalkModule(module);
}
private:
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp
index 30b28a75d..ea2377679 100644
--- a/src/passes/Vacuum.cpp
+++ b/src/passes/Vacuum.cpp
@@ -36,7 +36,7 @@ struct Vacuum : public WalkerPass<PostWalker<Vacuum>> {
Expression* replaceCurrent(Expression* expression) {
auto* old = getCurrent();
- WalkerPass<PostWalker<Vacuum>>::replaceCurrent(expression);
+ super::replaceCurrent(expression);
// also update the type updater
typeUpdater.noteReplacement(old, expression);
return expression;