[ConstraintSystem] Add an option to disable the constraint solver perf hacks.

This is helpful in experimenting with constraint solver changes that
might help us remove some of these unsound options. It's not ever mean
to be enabled, but if we're able to remove the things guarded by the
option we can eventually remove the option.
This commit is contained in:
Mark Lacey
2018-08-06 11:48:19 -07:00
parent b8cb40b950
commit 3c9cb97c86
6 changed files with 27 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
@@ -3539,6 +3539,8 @@ Type ConstraintSystem::generateConstraints(Pattern *pattern,
}
void ConstraintSystem::optimizeConstraints(Expr *e) {
if (TC.getLangOpts().DisableConstraintSolverPerformanceHacks)
return;
SmallVector<Expr *, 16> linkedExprs;