Skip to content

Commit 97f4edc

Browse files
committed
Reduce buildBlock overloads with pairwise buildBlock(combining:into:).
This patch replaces `O(2^arity)` overloads of `buildBlock` with `O(arity^2)` overloads of `buildBlock(combining:into:)` with the language feature implemented in swiftlang/swift#40799. This improves library compilation time and fixes an issue where nested captures did not have a flattened type. This also allows us to switch back to native tuples for `Match`, which will be addressed in a follow-up patch.
1 parent ba702f0 commit 97f4edc

File tree

6 files changed

+1036
-6007
lines changed

6 files changed

+1036
-6007
lines changed

Package.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ let package = Package(
4242
name: "_StringProcessing",
4343
dependencies: ["_MatchingEngine"],
4444
swiftSettings: [
45-
.unsafeFlags(["-enable-library-evolution"])
45+
.unsafeFlags(["-enable-library-evolution"]),
46+
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"])
4647
]),
4748
.target(
4849
name: "_Unicode",
4950
dependencies: []),
5051
.testTarget(
5152
name: "RegexTests",
52-
dependencies: ["_StringProcessing"]),
53+
dependencies: ["_StringProcessing"],
54+
swiftSettings: [
55+
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"])
56+
]),
5357
.target(
5458
name: "Prototypes",
5559
dependencies: ["_MatchingEngine"]),
@@ -73,7 +77,10 @@ let package = Package(
7377
// MARK: Exercises
7478
.target(
7579
name: "Exercises",
76-
dependencies: ["_MatchingEngine", "Prototypes", "_StringProcessing"]),
80+
dependencies: ["_MatchingEngine", "Prototypes", "_StringProcessing"],
81+
swiftSettings: [
82+
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"])
83+
]),
7784
.testTarget(
7885
name: "ExercisesTests",
7986
dependencies: ["Exercises"]),

0 commit comments

Comments
 (0)