OSDN Git Service

Clear TopOrder before assigning topological order. Some clean ups.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 7 Aug 2006 22:13:29 +0000 (22:13 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 7 Aug 2006 22:13:29 +0000 (22:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29546 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 0a6c43e..8db55c9 100644 (file)
@@ -474,6 +474,7 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
   if (!Erased && N->getValueType(N->getNumValues()-1) != MVT::Flag &&
       !N->isTargetOpcode()) {
     N->dump();
+    std::cerr << "\n";
     assert(0 && "Node is not in map!");
   }
 #endif
@@ -2497,7 +2498,7 @@ SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
   return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
 }
 
-// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
+/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
 /// This can cause recursive merging of nodes in the DAG.
 ///
 /// This version assumes From/To have a single result value.
@@ -2711,6 +2712,7 @@ unsigned SelectionDAG::AssignTopologicalOrder(std::vector<SDNode*> &TopOrder) {
       Sources.push_back(N);
   }
 
+  TopOrder.clear();
   while (!Sources.empty()) {
     SDNode *N = Sources.back();
     Sources.pop_back();