mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #82320 from xedin/hide-solver-hacks-behind-a-flag
[ConstraintSystem] Guard all the performance hacks with a flag
This commit is contained in:
@@ -983,9 +983,6 @@ namespace swift {
|
||||
/// is for testing purposes.
|
||||
std::vector<std::string> DebugForbidTypecheckPrefixes;
|
||||
|
||||
/// Disable the shrink phase of the expression type checker.
|
||||
bool SolverDisableShrink = false;
|
||||
|
||||
/// Enable experimental operator designated types feature.
|
||||
bool EnableOperatorDesignatedTypes = false;
|
||||
|
||||
|
||||
@@ -856,10 +856,6 @@ def solver_scope_threshold_EQ : Joined<["-"], "solver-scope-threshold=">,
|
||||
def solver_trail_threshold_EQ : Joined<["-"], "solver-trail-threshold=">,
|
||||
HelpText<"Expression type checking trail change limit">;
|
||||
|
||||
def solver_disable_shrink :
|
||||
Flag<["-"], "solver-disable-shrink">,
|
||||
HelpText<"Disable the shrink phase of expression type checking">;
|
||||
|
||||
def solver_disable_splitter : Flag<["-"], "solver-disable-splitter">,
|
||||
HelpText<"Disable the component splitter phase of expression type checking">;
|
||||
|
||||
|
||||
@@ -3586,6 +3586,13 @@ public:
|
||||
return Options.contains(ConstraintSystemFlags::ForCodeCompletion);
|
||||
}
|
||||
|
||||
/// Check whether type-checker performance hacks has been explicitly
|
||||
/// disabled by a flag.
|
||||
bool performanceHacksEnabled() const {
|
||||
return !getASTContext()
|
||||
.TypeCheckerOpts.DisableConstraintSolverPerformanceHacks;
|
||||
}
|
||||
|
||||
/// Log and record the application of the fix. Return true iff any
|
||||
/// subsequent solution would be worse than the best known solution.
|
||||
bool recordFix(ConstraintFix *fix, unsigned impact = 1);
|
||||
|
||||
Reference in New Issue
Block a user