Skip to content

Commit 4c6dd36

Browse files
committed
[TypeChecker] Bring back SolverDisableShrink
1 parent 276be15 commit 4c6dd36

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

include/swift/Basic/LangOptions.h

+3
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,9 @@ namespace swift {
906906
/// is for testing purposes.
907907
std::vector<std::string> DebugForbidTypecheckPrefixes;
908908

909+
/// Disable the shrink phase of the expression type checker.
910+
bool SolverDisableShrink = false;
911+
909912
/// Enable experimental operator designated types feature.
910913
bool EnableOperatorDesignatedTypes = false;
911914

include/swift/Option/FrontendOptions.td

+4
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,10 @@ def solver_scope_threshold_EQ : Joined<["-"], "solver-scope-threshold=">,
832832
def solver_trail_threshold_EQ : Joined<["-"], "solver-trail-threshold=">,
833833
HelpText<"Expression type checking trail change limit">;
834834

835+
def solver_disable_shrink :
836+
Flag<["-"], "solver-disable-shrink">,
837+
HelpText<"Disable the shrink phase of expression type checking">;
838+
835839
def solver_disable_splitter : Flag<["-"], "solver-disable-splitter">,
836840
HelpText<"Disable the component splitter phase of expression type checking">;
837841

lib/Frontend/CompilerInvocation.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1859,6 +1859,9 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
18591859
Opts.DebugForbidTypecheckPrefixes.push_back(A);
18601860
}
18611861

1862+
if (Args.getLastArg(OPT_solver_disable_shrink))
1863+
Opts.SolverDisableShrink = true;
1864+
18621865
if (Args.getLastArg(OPT_solver_disable_splitter))
18631866
Opts.SolverDisableSplitter = true;
18641867

validation-test/Sema/type_checker_perf/fast/array_concatenation.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift
1+
// RUN: %target-typecheck-verify-swift -solver-disable-shrink
22

33
// Self-contained test case
44
protocol P1 {}; func f<T: P1>(_: T, _: T) -> T { fatalError() }

validation-test/Sema/type_checker_perf/fast/property_vs_unapplied_func.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
1+
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1 -solver-disable-shrink
22
// REQUIRES: tools-release,no_asan
33

44
struct Date {

validation-test/Sema/type_checker_perf/slow/rdar26564101.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
1+
// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1 -solver-disable-shrink
22
// REQUIRES: tools-release,no_asan
33
// UNSUPPORTED: swift_test_mode_optimize_none && OS=linux-gnu
44

0 commit comments

Comments
 (0)