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
This commit is contained in:
Evan Cheng 2006-08-07 22:13:29 +00:00
parent 3b97acdbdb
commit 99157a00a6

View 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();