[llvm-commits] [llvm] r114474 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Chris Lattner sabre at nondot.org
Tue Sep 21 13:46:40 PDT 2010


Author: lattner
Date: Tue Sep 21 15:46:40 2010
New Revision: 114474

URL: http://llvm.org/viewvc/llvm-project?rev=114474&view=rev
Log:
correct this logic.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=114474&r1=114473&r2=114474&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Sep 21 15:46:40 2010
@@ -2087,8 +2087,8 @@
       unsigned RecNo = MatcherTable[MatcherIndex++];
       assert(RecNo < RecordedNodes.size() && "Invalid CheckComplexPat");
       SDNode *Parent = 0;
-      if (NodeStack.size() > 1)
-        Parent = NodeStack[NodeStack.size()-2].getNode();
+      if (!NodeStack.empty())
+        Parent = NodeStack[NodeStack.size()-1].getNode();
       
       if (!CheckComplexPattern(NodeToMatch, Parent, RecordedNodes[RecNo], CPNum,
                                RecordedNodes))





More information about the llvm-commits mailing list