Skip to content

Commit 7eee99a

Browse files
authored
Merge pull request swiftlang#19749 from rudkx/fix-short-circuiting
[ConstraintSystem] Tweak -disable-constraint-solver-performance-hacks.
2 parents 9ccabe4 + 6a3aa75 commit 7eee99a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sema/CSStep.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,6 @@ bool DisjunctionStep::shouldStopAt(const DisjunctionChoice &choice) const {
493493
bool DisjunctionStep::shortCircuitDisjunctionAt(
494494
Constraint *currentChoice, Constraint *lastSuccessfulChoice) const {
495495
auto &ctx = CS.getASTContext();
496-
if (ctx.LangOpts.DisableConstraintSolverPerformanceHacks)
497-
return false;
498496

499497
// If the successfully applied constraint is favored, we'll consider that to
500498
// be the "best".
@@ -515,6 +513,9 @@ bool DisjunctionStep::shortCircuitDisjunctionAt(
515513
if (currentChoice->getFix() && !lastSuccessfulChoice->getFix())
516514
return true;
517515

516+
if (ctx.LangOpts.DisableConstraintSolverPerformanceHacks)
517+
return false;
518+
518519
if (auto restriction = currentChoice->getRestriction()) {
519520
// Non-optional conversions are better than optional-to-optional
520521
// conversions.

0 commit comments

Comments
 (0)