Add a frontend option to disable the "shrink" part of the solver.

We sometimes see expression type checking times increase dramatically
when this is enabled, and having a way to disable will make it
possible to easily do measurements to determine the cost/benefit of
having this enabled.
This commit is contained in:
Mark Lacey
2018-06-19 10:21:19 -07:00
parent 50fb3b8496
commit 14f3f3e08a
4 changed files with 16 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
@@ -279,6 +279,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.SolverShrinkUnsolvedThreshold = threshold;
}
if (const Arg *A = Args.getLastArg(OPT_solver_disable_shrink))
Opts.SolverDisableShrink = true;
if (const Arg *A = Args.getLastArg(OPT_value_recursion_threshold)) {
unsigned threshold;
if (StringRef(A->getValue()).getAsInteger(10, threshold)) {