Clear TopOrder before assigning topological order. Some clean ups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29546 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 0a6c43e..8db55c9 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -474,6 +474,7 @@
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 @@
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 @@
Sources.push_back(N);
}
+ TopOrder.clear();
while (!Sources.empty()) {
SDNode *N = Sources.back();
Sources.pop_back();