remove dead code, simplify.
authorChris Lattner <sabre@nondot.org>
Mon, 1 Mar 2010 22:19:47 +0000 (22:19 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 1 Mar 2010 22:19:47 +0000 (22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97510 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelMatcherOpt.cpp

index 97ddf67dd40b42963edbd6782b34877b2e6e97f6..ce97fb47bdba18f4ff6fb2f675c55e58e216e401 100644 (file)
@@ -392,16 +392,10 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) {
   }
   
 
-  // Reassemble a new Scope node.
-  assert(!NewOptionsToMatch.empty() &&
-         "Where'd all our children go?  Did we really factor everything??");
-  if (NewOptionsToMatch.empty())
-    MatcherPtr.reset(0);
-  else {
-    Scope->setNumChildren(NewOptionsToMatch.size());
-    for (unsigned i = 0, e = NewOptionsToMatch.size(); i != e; ++i)
-      Scope->resetChild(i, NewOptionsToMatch[i]);
-  }
+  // Reassemble the Scope node with the adjusted children.
+  Scope->setNumChildren(NewOptionsToMatch.size());
+  for (unsigned i = 0, e = NewOptionsToMatch.size(); i != e; ++i)
+    Scope->resetChild(i, NewOptionsToMatch[i]);
 }
 
 Matcher *llvm::OptimizeMatcher(Matcher *TheMatcher,