File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1510,6 +1510,22 @@ bool ConstraintSystem::Candidate::solve() {
1510
1510
return true ;
1511
1511
}
1512
1512
1513
+ if (TC.getLangOpts ().DebugConstraintSolver ) {
1514
+ auto &log = cs.getASTContext ().TypeCheckerDebug ->getStream ();
1515
+ log << " --- Solving candidate for shrinking at " ;
1516
+ auto R = E->getSourceRange ();
1517
+ if (R.isValid ()) {
1518
+ R.print (log, TC.Context .SourceMgr , /* PrintText=*/ false );
1519
+ } else {
1520
+ log << " <invalid range>" ;
1521
+ }
1522
+ log << " ---\n " ;
1523
+
1524
+ E->print (log);
1525
+ log << ' \n ' ;
1526
+ cs.print (log);
1527
+ }
1528
+
1513
1529
// If there is contextual type present, add an explicit "conversion"
1514
1530
// constraint to the system.
1515
1531
if (!CT.isNull ()) {
@@ -1532,6 +1548,20 @@ bool ConstraintSystem::Candidate::solve() {
1532
1548
cs.solveRec (solutions, FreeTypeVariableBinding::Allow);
1533
1549
}
1534
1550
1551
+ if (TC.getLangOpts ().DebugConstraintSolver ) {
1552
+ auto &log = cs.getASTContext ().TypeCheckerDebug ->getStream ();
1553
+ if (solutions.empty ()) {
1554
+ log << " --- No Solutions ---\n " ;
1555
+ } else {
1556
+ log << " --- Solutions ---\n " ;
1557
+ for (unsigned i = 0 , n = solutions.size (); i != n; ++i) {
1558
+ auto &solution = solutions[i];
1559
+ log << " --- Solution #" << i << " ---\n " ;
1560
+ solution.dump (log);
1561
+ }
1562
+ }
1563
+ }
1564
+
1535
1565
// Record found solutions as suggestions.
1536
1566
this ->applySolutions (solutions);
1537
1567
You can’t perform that action at this time.
0 commit comments