Skip to content

Commit 3c529c8

Browse files
committed
Sema: Add -disable-optimized-restrictions flag
1 parent 541757a commit 3c529c8

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
@@ -849,6 +849,9 @@ def solver_disable_splitter : Flag<["-"], "solver-disable-splitter">,
849849
def disable_constraint_solver_performance_hacks : Flag<["-"], "disable-constraint-solver-performance-hacks">,
850850
HelpText<"Disable all the hacks in the constraint solver">;
851851

852+
def disable_optimized_restrictions : Flag<["-"], "disable-optimized-restrictions">,
853+
HelpText<"Disable an experimental constraint solver optimization">;
854+
852855
def enable_operator_designated_types :
853856
Flag<["-"], "enable-operator-designated-types">,
854857
HelpText<"Enable operator designated types">;

lib/Frontend/CompilerInvocation.cpp

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

1868+
if (Args.getLastArg(OPT_disable_optimized_restrictions))
1869+
Opts.DisableOptimizedRestrictions = true;
1870+
18681871
if (FrontendOpts.RequestedAction == FrontendOptions::ActionType::Immediate)
18691872
Opts.DeferToRuntime = true;
18701873

0 commit comments

Comments
 (0)