Don't mess up SCC traversal when a node has null edges out of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-04-25 19:16:17 +00:00
parent 69c11bb285
commit 63320cc841

View File

@ -1430,11 +1430,12 @@ VisitForSCCs(const DSNode *N) {
// Otherwise, check all successors. // Otherwise, check all successors.
bool AnyDirectSuccessorsReachClonedNodes = false; bool AnyDirectSuccessorsReachClonedNodes = false;
for (DSNode::const_edge_iterator EI = N->edge_begin(), EE = N->edge_end(); for (DSNode::const_edge_iterator EI = N->edge_begin(), EE = N->edge_end();
EI != EE; ++EI) { EI != EE; ++EI)
std::pair<unsigned, bool> &SuccInfo = VisitForSCCs(EI->getNode()); if (DSNode *Succ = EI->getNode()) {
if (SuccInfo.first < Min) Min = SuccInfo.first; std::pair<unsigned, bool> &SuccInfo = VisitForSCCs(Succ);
AnyDirectSuccessorsReachClonedNodes |= SuccInfo.second; if (SuccInfo.first < Min) Min = SuccInfo.first;
} AnyDirectSuccessorsReachClonedNodes |= SuccInfo.second;
}
if (Min != MyId) if (Min != MyId)
return ThisNodeInfo; // Part of a large SCC. Leave self on stack. return ThisNodeInfo; // Part of a large SCC. Leave self on stack.