[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:
Pavel Yaskevich
2017-07-20 12:44:48 -07:00
parent 3f308b7a99
commit 4f8872598b
5 changed files with 23 additions and 1 deletions

View File

@@ -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)) {