mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSolver] NFC: Add option to control early termination of shrinking phase
Currently we have a number of unsolved disjunctions hard-coded to 5, which breaks some existing code by terminating shrinking too early. This patch makes it a command-line option so users have control over what that threshold can be. Resolves: rdar://problem/33433595
This commit is contained in:
@@ -1060,6 +1060,17 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.SolverMemoryThreshold = threshold;
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_solver_shrink_unsolved_threshold)) {
|
||||
unsigned threshold;
|
||||
if (StringRef(A->getValue()).getAsInteger(10, threshold)) {
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
A->getAsString(Args), A->getValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
Opts.SolverShrinkUnsolvedThreshold = threshold;
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_value_recursion_threshold)) {
|
||||
unsigned threshold;
|
||||
if (StringRef(A->getValue()).getAsInteger(10, threshold)) {
|
||||
|
||||
Reference in New Issue
Block a user