Skip to content

Commit

Permalink
Merge pull request swiftlang#7519 from rudkx/dump-source-range
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-ci authored Feb 16, 2017
2 parents 65f1901 + 58b14ff commit 36a60d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/Sema/CSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,18 @@ ConstraintSystem::solve(Expr *&expr,
ExprTypeCheckListener *listener,
SmallVectorImpl<Solution> &solutions,
FreeTypeVariableBinding allowFreeTypeVariables) {
if (TC.getLangOpts().DebugConstraintSolver) {
auto &log = getASTContext().TypeCheckerDebug->getStream();
log << "---Constraint solving for the expression at ";
auto R = expr->getSourceRange();
if (R.isValid()) {
R.print(log, TC.Context.SourceMgr, /*PrintText=*/ false);
} else {
log << "<invalid range>";
}
log << "---\n";
}

assert(!solverState && "use solveRec for recursive calls");

// Try to shrink the system by reducing disjunction domains. This
Expand Down

0 comments on commit 36a60d2

Please sign in to comment.