- while (! VisitStack.empty())
- {
- DFSVisitChildren();
-
- assert(VisitStack.back().second ==
- GT::child_end(VisitStack.back().first));
- NodeType* visitingN = VisitStack.back().first;
- unsigned minVisitNum = MinVisitNumStack.back();
- VisitStack.pop_back();
- MinVisitNumStack.pop_back();
- if (! MinVisitNumStack.empty() && MinVisitNumStack.back() > minVisitNum)
- MinVisitNumStack.back() = minVisitNum;
-
- //DEBUG(std::cerr << "TarjanSCC: Popped node " << visitingN <<
- // " : minVisitNum = " << minVisitNum << "; Node visit num = " <<
- // nodeVisitNumbers[visitingN] << "\n");
-
- if (minVisitNum == nodeVisitNumbers[visitingN])
- { // A full SCC is on the SCCNodeStack! It includes all nodes below
- // visitingN on the stack. Copy those nodes to CurrentSCC,
- // reset their minVisit values, and return (this suspends
- // the DFS traversal till the next ++).
- do {
- CurrentSCC.push_back(SCCNodeStack.back());
- SCCNodeStack.pop_back();
- nodeVisitNumbers[CurrentSCC.back()] = ~0UL;
- } while (CurrentSCC.back() != visitingN);
- return;
- }
- }
+ while (!VisitStack.empty()) {
+ DFSVisitChildren();
+ assert(VisitStack.back().second ==GT::child_end(VisitStack.back().first));
+ NodeType* visitingN = VisitStack.back().first;
+ unsigned minVisitNum = MinVisitNumStack.back();
+ VisitStack.pop_back();
+ MinVisitNumStack.pop_back();
+ if (!MinVisitNumStack.empty() && MinVisitNumStack.back() > minVisitNum)
+ MinVisitNumStack.back() = minVisitNum;
+
+ //DEBUG(std::cerr << "TarjanSCC: Popped node " << visitingN <<
+ // " : minVisitNum = " << minVisitNum << "; Node visit num = " <<
+ // nodeVisitNumbers[visitingN] << "\n");
+
+ if (minVisitNum == nodeVisitNumbers[visitingN]) {
+ // A full SCC is on the SCCNodeStack! It includes all nodes below
+ // visitingN on the stack. Copy those nodes to CurrentSCC,
+ // reset their minVisit values, and return (this suspends
+ // the DFS traversal till the next ++).
+ do {
+ CurrentSCC.push_back(SCCNodeStack.back());
+ SCCNodeStack.pop_back();
+ nodeVisitNumbers[CurrentSCC.back()] = ~0UL;
+ } while (CurrentSCC.back() != visitingN);
+ return;
+ }
+ }