Commit 7ba6052 Mikhail Glushenkov
committed
1 parent 072e99e commit 7ba6052 Copy full SHA for 7ba6052
File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,8 @@ int CompilationGraph::CheckMultipleDefaultEdges() const {
390
390
int ret = 0 ;
391
391
InputLanguagesSet Dummy;
392
392
393
+ // For all nodes, just iterate over the outgoing edges and check if there is
394
+ // more than one edge with maximum weight.
393
395
for (const_nodes_iterator B = this ->NodesMap .begin (),
394
396
E = this ->NodesMap .end (); B != E; ++B) {
395
397
const Node& N = B->second ;
@@ -423,6 +425,9 @@ int CompilationGraph::CheckCycles() {
423
425
std::queue<Node*> Q;
424
426
Q.push (&getNode (" root" ));
425
427
428
+ // Try to delete all nodes that have no ingoing edges, starting from the
429
+ // root. If there are any nodes left after this operation, then we have a
430
+ // cycle. This relies on '--check-graph' not performing the topological sort.
426
431
while (!Q.empty ()) {
427
432
Node* A = Q.front ();
428
433
Q.pop ();
@@ -447,7 +452,6 @@ int CompilationGraph::CheckCycles() {
447
452
return 0 ;
448
453
}
449
454
450
-
451
455
int CompilationGraph::Check () {
452
456
// We try to catch as many errors as we can in one go.
453
457
int ret = 0 ;
You can’t perform that action at this time.
0 commit comments