From 382fba5c9b6531515977fbe5967148e04d978106 Mon Sep 17 00:00:00 2001 From: Pavel Yaskevich Date: Wed, 7 May 2025 16:29:40 -0700 Subject: [PATCH 1/2] [Swift] Add migrate mode to a few upcoming flags that currently support it Add a third option (to complement yes/no) for some features that enables them in migration mode. Currently supported by: - `ExistentialAny` - `NonisolatedNonsendingByDefault` Resolves: rdar://145768088 --- .../SWBUniversalPlatform/Specs/Swift.xcspec | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Sources/SWBUniversalPlatform/Specs/Swift.xcspec b/Sources/SWBUniversalPlatform/Specs/Swift.xcspec index 67972fa7..77aef546 100644 --- a/Sources/SWBUniversalPlatform/Specs/Swift.xcspec +++ b/Sources/SWBUniversalPlatform/Specs/Swift.xcspec @@ -795,11 +795,17 @@ { Name = "SWIFT_UPCOMING_FEATURE_EXISTENTIAL_ANY"; - Type = Boolean; - DefaultValue = NO; + Type = Enumeration; + Values = ( + Yes, + Migrate, + No, + ); + DefaultValue = No; CommandLineArgs = { - YES = ( "-enable-upcoming-feature", "ExistentialAny" ); - NO = (); + Yes = ( "-enable-upcoming-feature", "ExistentialAny" ); + Migrate = ( "-enable-upcoming-feature", "ExistentialAny:migrate" ); + No = (); }; DisplayName = "Require Existential any"; Category = "Upcoming Features"; @@ -821,11 +827,17 @@ { Name = "SWIFT_UPCOMING_FEATURE_NONISOLATED_NONSENDING_BY_DEFAULT"; - Type = Boolean; - DefaultValue = NO; + Type = Enumeration; + Values = ( + Yes, + Migrate, + No, + ); + DefaultValue = No; CommandLineArgs = { - YES = ( "-enable-upcoming-feature", "NonisolatedNonsendingByDefault" ); - NO = (); + Yes = ( "-enable-upcoming-feature", "NonisolatedNonsendingByDefault" ); + Migrate = ( "-enable-upcoming-feature", "NonisolatedNonsendingByDefault:migrate" ); + No = (); }; DisplayName = "Nonisolated Nonsending By Default"; Category = "Upcoming Features"; From 4ade115d8c694571441248c7965b82b87690a290 Mon Sep 17 00:00:00 2001 From: Pavel Yaskevich Date: Wed, 7 May 2025 16:40:45 -0700 Subject: [PATCH 2/2] [Swift] NFC: Change display name for `NonisolatedNonsendingByDefault` to use modifier spelling --- Sources/SWBUniversalPlatform/Specs/Swift.xcspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SWBUniversalPlatform/Specs/Swift.xcspec b/Sources/SWBUniversalPlatform/Specs/Swift.xcspec index 77aef546..07cd6843 100644 --- a/Sources/SWBUniversalPlatform/Specs/Swift.xcspec +++ b/Sources/SWBUniversalPlatform/Specs/Swift.xcspec @@ -839,7 +839,7 @@ Migrate = ( "-enable-upcoming-feature", "NonisolatedNonsendingByDefault:migrate" ); No = (); }; - DisplayName = "Nonisolated Nonsending By Default"; + DisplayName = "nonisolated(nonsending) By Default"; Category = "Upcoming Features"; Description = "Runs nonisolated async functions on the caller's actor by default unless the function is explicitly marked `@concurrent`."; },