Skip to content

Commit bb33931

Browse files
committed
Revise the "too complex" heuristic.
Revise the heuristic so that it does not differ between Swift versions, and so that it is always based on the number of scopes we've opened. The memory threshold and (very long) timer are also still in place as well.
1 parent 0a46b4b commit bb33931

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)