summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcherOpt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-25 01:56:48 +0000
committerChris Lattner <sabre@nondot.org>2010-02-25 01:56:48 +0000
commit60df53e30a7e39c884f4ca4eb03346bea5825109 (patch)
tree8e8d8be88cebe5522a27c7768127b9c338af7837 /utils/TableGen/DAGISelMatcherOpt.cpp
parent3ce2b097973e4b1a553373471cf2a5d9805903c5 (diff)
downloadllvm-60df53e30a7e39c884f4ca4eb03346bea5825109.tar.gz
llvm-60df53e30a7e39c884f4ca4eb03346bea5825109.tar.bz2
llvm-60df53e30a7e39c884f4ca4eb03346bea5825109.tar.xz
rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does. Switch the sense of the Next and the Check arms to be more logical. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcherOpt.cpp')
-rw-r--r--utils/TableGen/DAGISelMatcherOpt.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp
index 796b815a93..623d8703e4 100644
--- a/utils/TableGen/DAGISelMatcherOpt.cpp
+++ b/utils/TableGen/DAGISelMatcherOpt.cpp
@@ -14,14 +14,14 @@
#include "DAGISelMatcher.h"
using namespace llvm;
-static void ContractNodes(OwningPtr<MatcherNode> &Matcher) {
+static void ContractNodes(OwningPtr<MatcherNode> &MatcherPtr) {
// If we reached the end of the chain, we're done.
- MatcherNode *N = Matcher.get();
+ MatcherNode *N = MatcherPtr.get();
if (N == 0) return;
- // If we have a push node, walk down both edges.
- if (PushMatcherNode *Push = dyn_cast<PushMatcherNode>(N))
- ContractNodes(Push->getFailurePtr());
+ // If we have a scope node, walk down both edges.
+ if (ScopeMatcherNode *Push = dyn_cast<ScopeMatcherNode>(N))
+ ContractNodes(Push->getCheckPtr());
// If we found a movechild node with a node that comes in a 'foochild' form,
// transform it.
@@ -35,25 +35,24 @@ static void ContractNodes(OwningPtr<MatcherNode> &Matcher) {
if (New) {
// Insert the new node.
- New->setNext(Matcher.take());
- Matcher.reset(New);
+ New->setNext(MatcherPtr.take());
+ MatcherPtr.reset(New);
// Remove the old one.
MC->setNext(MC->getNext()->takeNext());
- return ContractNodes(Matcher);
+ return ContractNodes(MatcherPtr);
}
}
if (MoveChildMatcherNode *MC = dyn_cast<MoveChildMatcherNode>(N))
if (MoveParentMatcherNode *MP =
dyn_cast<MoveParentMatcherNode>(MC->getNext())) {
- Matcher.reset(MP->takeNext());
- return ContractNodes(Matcher);
+ MatcherPtr.reset(MP->takeNext());
+ return ContractNodes(MatcherPtr);
}
ContractNodes(N->getNextPtr());
}
-
MatcherNode *llvm::OptimizeMatcher(MatcherNode *Matcher) {
OwningPtr<MatcherNode> MatcherPtr(Matcher);
ContractNodes(MatcherPtr);