@@ -429,6 +429,7 @@ impl DepGraph {
429
429
tcx : TyCtxt ,
430
430
dep_node : & DepNode )
431
431
-> Option < DepNodeIndex > {
432
+ debug ! ( "try_mark_green({:?}) - BEGIN" , dep_node) ;
432
433
let data = self . data . as_ref ( ) . unwrap ( ) ;
433
434
434
435
debug_assert ! ( !data. colors. borrow( ) . contains_key( dep_node) ) ;
@@ -440,6 +441,7 @@ impl DepGraph {
440
441
// eagerly marked as either red/green before any queries are
441
442
// executed.
442
443
debug_assert ! ( dep_node. extract_def_id( tcx) . is_none( ) ) ;
444
+ debug ! ( "try_mark_green({:?}) - END - DepNode is deleted input" , dep_node) ;
443
445
return None ;
444
446
}
445
447
@@ -454,6 +456,8 @@ impl DepGraph {
454
456
None => {
455
457
// This DepNode did not exist in the previous compilation session,
456
458
// so we cannot mark it as green.
459
+ debug ! ( "try_mark_green({:?}) - END - DepNode does not exist in \
460
+ current compilation session anymore", dep_node) ;
457
461
return None
458
462
}
459
463
} ;
@@ -469,35 +473,56 @@ impl DepGraph {
469
473
// This dependency has been marked as green before, we are
470
474
// still fine and can continue with checking the other
471
475
// dependencies.
476
+ debug ! ( "try_mark_green({:?}) --- found dependency {:?} to \
477
+ be immediately green", dep_node, dep_dep_node) ;
472
478
current_deps. push ( node_index) ;
473
479
}
474
480
Some ( DepNodeColor :: Red ) => {
475
481
// We found a dependency the value of which has changed
476
482
// compared to the previous compilation session. We cannot
477
483
// mark the DepNode as green and also don't need to bother
478
484
// with checking any of the other dependencies.
485
+ debug ! ( "try_mark_green({:?}) - END - dependency {:?} was \
486
+ immediately red", dep_node, dep_dep_node) ;
479
487
return None
480
488
}
481
489
None => {
482
490
if dep_dep_node. kind . is_input ( ) {
483
491
// This input does not exist anymore.
484
492
debug_assert ! ( dep_dep_node. extract_def_id( tcx) . is_none( ) ) ;
493
+ debug ! ( "try_mark_green({:?}) - END - dependency {:?} \
494
+ was deleted input", dep_node, dep_dep_node) ;
485
495
return None ;
486
496
}
487
497
498
+ debug ! ( "try_mark_green({:?}) --- state of dependency {:?} \
499
+ is unknown, trying to mark it green", dep_node,
500
+ dep_dep_node) ;
501
+
488
502
// We don't know the state of this dependency. Let's try to
489
503
// mark it green.
490
504
if let Some ( node_index) = self . try_mark_green ( tcx, dep_dep_node) {
505
+ debug ! ( "try_mark_green({:?}) --- managed to MARK \
506
+ dependency {:?} as green", dep_node, dep_dep_node) ;
491
507
current_deps. push ( node_index) ;
492
508
} else {
493
509
// We failed to mark it green, so we try to force the query.
510
+ debug ! ( "try_mark_green({:?}) --- trying to force \
511
+ dependency {:?}", dep_node, dep_dep_node) ;
494
512
if :: ty:: maps:: force_from_dep_node ( tcx, dep_dep_node) {
495
513
let dep_dep_node_color = data. colors . borrow ( ) . get ( dep_dep_node) . cloned ( ) ;
496
514
match dep_dep_node_color {
497
515
Some ( DepNodeColor :: Green ( node_index) ) => {
516
+ debug ! ( "try_mark_green({:?}) --- managed to \
517
+ FORCE dependency {:?} to green",
518
+ dep_node, dep_dep_node) ;
498
519
current_deps. push ( node_index) ;
499
520
}
500
521
Some ( DepNodeColor :: Red ) => {
522
+ debug ! ( "try_mark_green({:?}) - END - \
523
+ dependency {:?} was red after forcing",
524
+ dep_node,
525
+ dep_dep_node) ;
501
526
return None
502
527
}
503
528
None => {
@@ -507,6 +532,8 @@ impl DepGraph {
507
532
}
508
533
} else {
509
534
// The DepNode could not be forced.
535
+ debug ! ( "try_mark_green({:?}) - END - dependency {:?} \
536
+ could not be forced", dep_node, dep_dep_node) ;
510
537
return None
511
538
}
512
539
}
@@ -553,6 +580,7 @@ impl DepGraph {
553
580
. insert( * dep_node, DepNodeColor :: Green ( node_index) )
554
581
. is_none( ) ) ;
555
582
583
+ debug ! ( "try_mark_green({:?}) - END - successfully marked as green" , dep_node. kind) ;
556
584
Some ( node_index)
557
585
}
558
586
0 commit comments