// Replace this SCC with the NewNodes we collected above.
// FIXME: Simplify this when the SCC's datastructure is just a list.
Nodes.clear();
- NodeSet.clear();
// Now we need to reconnect the current SCC to the graph.
bool IsLeafSCC = true;
N->DFSNumber = -1;
N->LowLink = -1;
Nodes.push_back(N);
- NodeSet.insert(&N->getFunction());
for (Node &ChildN : *N) {
if (NewNodes.count(&ChildN))
continue;
SCCMap[SCCN] = NewSCC;
NewSCC->Nodes.push_back(SCCN);
- bool Inserted =
- NewSCC->NodeSet.insert(&SCCN->getFunction());
- (void)Inserted;
- assert(Inserted && "Cannot have duplicates in the DFSStack!");
}
DFSStack.erase(SCCBegin, DFSStack.end());
bool IsLeafSCC = true;
for (Node *SCCN : NewSCC->Nodes)
for (Node &SCCChildN : *SCCN) {
- if (NewSCC->NodeSet.count(&SCCChildN.getFunction()))
+ if (SCCMap.lookup(&SCCChildN) == NewSCC)
continue;
SCC &ChildSCC = *SCCMap.lookup(&SCCChildN);
ChildSCC.ParentSCCs.insert(NewSCC);