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

llvm-svn: 21536
This commit is contained in:
Chris Lattner 2005-04-25 19:16:17 +00:00
parent 37b6b097ff
commit 5965359d8f
1 changed files with 6 additions and 5 deletions

View File

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