Skip to content

Commit ce6b06d

Browse files
committed
Sema: Change -solver-memory-threshold into a frontend flag for consistency with the others
1 parent 751ab6f commit ce6b06d

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,9 @@ def downgrade_typecheck_interface_error : Flag<["-"], "downgrade-typecheck-inter
847847
def enable_volatile_modules : Flag<["-"], "enable-volatile-modules">,
848848
HelpText<"Load Swift modules in memory">;
849849

850+
def solver_memory_threshold_EQ : Joined<["-"], "solver-memory-threshold=">,
851+
HelpText<"Set the upper bound for memory consumption, in bytes, by the constraint solver">;
852+
850853
def solver_expression_time_threshold_EQ : Joined<["-"], "solver-expression-time-threshold=">,
851854
HelpText<"Expression type checking timeout, in seconds">;
852855

include/swift/Option/Options.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,6 @@ def import_cf_types : Flag<["-"], "import-cf-types">,
799799
Flags<[FrontendOption, HelpHidden]>,
800800
HelpText<"Recognize and import CF types as class types">;
801801

802-
def solver_memory_threshold : Separate<["-"], "solver-memory-threshold">,
803-
Flags<[FrontendOption, HelpHidden, DoesNotAffectIncrementalBuild]>,
804-
HelpText<"Set the upper bound for memory consumption, in bytes, by the constraint solver">;
805-
806802
def solver_shrink_unsolved_threshold : Separate<["-"], "solver-shrink-unsolved-threshold">,
807803
Flags<[FrontendOption, HelpHidden, DoesNotAffectIncrementalBuild]>,
808804
HelpText<"Set The upper bound to number of sub-expressions unsolved before termination of the shrink phrase">;

lib/Driver/ToolChains.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
312312
inputArgs.AddLastArg(arguments, options::OPT_nostdlibimport);
313313
inputArgs.AddLastArg(arguments, options::OPT_parse_stdlib);
314314
inputArgs.AddLastArg(arguments, options::OPT_resource_dir);
315-
inputArgs.AddLastArg(arguments, options::OPT_solver_memory_threshold);
316315
inputArgs.AddLastArg(arguments, options::OPT_value_recursion_threshold);
317316
inputArgs.AddLastArg(arguments, options::OPT_warn_swift3_objc_inference);
318317
inputArgs.AddLastArg(arguments, options::OPT_Rpass_EQ);

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
19441944
Opts.SwitchCheckingInvocationThreshold);
19451945
setUnsignedIntegerArgument(OPT_debug_constraints_attempt,
19461946
Opts.DebugConstraintSolverAttempt);
1947-
setUnsignedIntegerArgument(OPT_solver_memory_threshold,
1947+
setUnsignedIntegerArgument(OPT_solver_memory_threshold_EQ,
19481948
Opts.SolverMemoryThreshold);
19491949
setUnsignedIntegerArgument(OPT_solver_scope_threshold_EQ,
19501950
Opts.SolverScopeThreshold);

test/Misc/expression_too_complex_2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -solver-memory-threshold 32000
1+
// RUN: %target-typecheck-verify-swift -solver-memory-threshold=32000
22
// REQUIRES: OS=ios
33
import UIKit
44
class MyViewCell: UITableViewCell {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// RUN: %target-typecheck-verify-swift -solver-memory-threshold 1
1+
// RUN: %target-typecheck-verify-swift -solver-memory-threshold=1
22

33
func foo() { _ = 1 } // expected-error {{the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions}}

0 commit comments

Comments
 (0)