From 60df53e30a7e39c884f4ca4eb03346bea5825109 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 25 Feb 2010 01:56:48 +0000 Subject: 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 --- utils/TableGen/DAGISelMatcherOpt.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'utils/TableGen/DAGISelMatcherOpt.cpp') diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp index 796b815..623d870 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 &Matcher) { +static void ContractNodes(OwningPtr &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(N)) - ContractNodes(Push->getFailurePtr()); + // If we have a scope node, walk down both edges. + if (ScopeMatcherNode *Push = dyn_cast(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 &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(N)) if (MoveParentMatcherNode *MP = dyn_cast(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 MatcherPtr(Matcher); ContractNodes(MatcherPtr); -- cgit v1.1