File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ add_swift_host_library(swiftSema STATIC
13
13
CSStep.cpp
14
14
CSTrail.cpp
15
15
CSFix.cpp
16
+ CSOptimizer.cpp
16
17
CSDiagnostics.cpp
17
18
CodeSynthesis.cpp
18
19
CodeSynthesisDistributedActor.cpp
Original file line number Diff line number Diff line change
1
+ // ===--- CSOptimizer.cpp - Constraint Optimizer ---------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ // ===----------------------------------------------------------------------===//
12
+ //
13
+ // This file implements disjunction and other constraint optimizations.
14
+ //
15
+ // ===----------------------------------------------------------------------===//
16
+
17
+ #include " swift/Sema/ConstraintSystem.h"
18
+ #include " llvm/ADT/SmallVector.h"
19
+
20
+ using namespace swift ;
21
+ using namespace constraints ;
22
+
23
+ void ConstraintSystem::optimizeDisjunctions (
24
+ SmallVectorImpl<Constraint *> &disjunctions) {
25
+ }
Original file line number Diff line number Diff line change @@ -1835,6 +1835,8 @@ Constraint *ConstraintSystem::selectDisjunction() {
1835
1835
if (disjunctions.empty ())
1836
1836
return nullptr ;
1837
1837
1838
+ optimizeDisjunctions (disjunctions);
1839
+
1838
1840
if (auto *disjunction = selectBestBindingDisjunction (*this , disjunctions))
1839
1841
return disjunction;
1840
1842
You can’t perform that action at this time.
0 commit comments