Skip to content

Commit c7e7a04

Browse files
authored
Merge pull request #17667 from rudkx/revise-too-complex
Revise the "too complex" heuristic.
2 parents 78e9e90 + bb33931 commit c7e7a04

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

lib/Sema/ConstraintSystem.h

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,26 +3136,9 @@ class ConstraintSystem {
31363136
return true;
31373137
}
31383138

3139-
if (!getASTContext().isSwiftVersion3()) {
3140-
if (CountScopes < TypeCounter)
3141-
return false;
3142-
3143-
// If we haven't explored a relatively large number of possibilities
3144-
// yet, continue.
3145-
if (CountScopes <= 16 * 1024)
3146-
return false;
3147-
3148-
// Clearly exponential
3149-
if (TypeCounter < 32 && CountScopes > (1U << TypeCounter))
3150-
return true;
3151-
3152-
// Bail out once we've looked at a really large number of
3153-
// choices.
3154-
if (CountScopes > TC.Context.LangOpts.SolverBindingThreshold)
3155-
return true;
3156-
}
3157-
3158-
return false;
3139+
// Bail out once we've looked at a really large number of
3140+
// choices.
3141+
return CountScopes > TC.Context.LangOpts.SolverBindingThreshold;
31593142
}
31603143

31613144
LLVM_ATTRIBUTE_DEPRECATED(

0 commit comments

Comments
 (0)