Skip to content

Commit 0f21262

Browse files
committed
Sema: Add -disable-optimized-restrictions flag
1 parent 9311967 commit 0f21262

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,9 @@ namespace swift {
926926

927927
/// Disable the component splitter phase of the expression type checker.
928928
bool SolverDisableSplitter = false;
929+
930+
/// Disable some experimental optimizations.
931+
bool DisableOptimizedRestrictions = false;
929932
};
930933

931934
/// Options for controlling the behavior of the Clang importer.

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,9 @@ def solver_disable_splitter : Flag<["-"], "solver-disable-splitter">,
846846
def disable_constraint_solver_performance_hacks : Flag<["-"], "disable-constraint-solver-performance-hacks">,
847847
HelpText<"Disable all the hacks in the constraint solver">;
848848

849+
def disable_optimized_restrictions : Flag<["-"], "disable-optimized-restrictions">,
850+
HelpText<"Disable an experimental constraint solver optimization">;
851+
849852
def enable_operator_designated_types :
850853
Flag<["-"], "enable-operator-designated-types">,
851854
HelpText<"Enable operator designated types">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,9 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
18621862
if (Args.getLastArg(OPT_solver_disable_splitter))
18631863
Opts.SolverDisableSplitter = true;
18641864

1865+
if (Args.getLastArg(OPT_disable_optimized_restrictions))
1866+
Opts.DisableOptimizedRestrictions = true;
1867+
18651868
if (FrontendOpts.RequestedAction == FrontendOptions::ActionType::Immediate)
18661869
Opts.DeferToRuntime = true;
18671870

0 commit comments

Comments
 (0)