Skip to content

Commit 50b189b

Browse files
committed
[ConstraintSystem] Print cached expr types when debugging constraint solver.
1 parent 7db5721 commit 50b189b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,9 +1380,15 @@ ConstraintSystem::solve(Expr *&expr,
13801380
}
13811381

13821382
if (TC.getLangOpts().DebugConstraintSolver) {
1383+
auto getTypeOfExpr = [&](const Expr *E) -> Type { return getType(E); };
1384+
auto getTypeOfTypeLoc = [&](const TypeLoc &TL) -> Type {
1385+
return getType(TL);
1386+
};
1387+
13831388
auto &log = getASTContext().TypeCheckerDebug->getStream();
13841389
log << "---Initial constraints for the given expression---\n";
1385-
expr->print(log);
1390+
1391+
expr->print(log, getTypeOfExpr, getTypeOfTypeLoc);
13861392
log << "\n";
13871393
print(log);
13881394
}

0 commit comments

Comments
 (0)