Skip to content

Commit 5999743

Browse files
committed
Enable concurrency back-deployment in the compiler by default.
Remove the option that explicitly enables concurrency back-deployment, and instead always enable its support in the compiler. Remove the use of the extraneous CMake option as well.
1 parent 9d4ce58 commit 5999743

File tree

13 files changed

+9
-55
lines changed

13 files changed

+9
-55
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,6 @@ namespace swift {
301301
/// Enable experimental concurrency model.
302302
bool EnableExperimentalConcurrency = false;
303303

304-
/// Enable experimental back-deployment of the concurrency model.
305-
bool EnableExperimentalBackDeployConcurrency =
306-
SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY;
307-
308304
/// Enable experimental support for named opaque result types, e.g.
309305
/// `func f() -> <T> T`.
310306
bool EnableExperimentalNamedOpaqueTypes = false;

include/swift/Config.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@
1414

1515
#cmakedefine01 SWIFT_ENABLE_GLOBAL_ISEL_ARM64
1616

17-
#cmakedefine01 SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY
18-
1917
#endif // SWIFT_CONFIG_H

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@ def enable_experimental_concurrency :
247247
Flag<["-"], "enable-experimental-concurrency">,
248248
HelpText<"Enable experimental concurrency model">;
249249

250-
def enable_experimental_back_deploy_concurrency :
251-
Flag<["-"], "enable-experimental-back-deploy-concurrency">,
252-
HelpText<"Enable experimental back-deployment of the concurrency model">;
253-
254250
def enable_experimental_distributed :
255251
Flag<["-"], "enable-experimental-distributed">,
256252
HelpText<"Enable experimental 'distributed' actors and functions">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
422422
Opts.EnableExperimentalConcurrency |=
423423
Args.hasArg(OPT_enable_experimental_concurrency);
424424

425-
Opts.EnableExperimentalBackDeployConcurrency |=
426-
Args.hasArg(OPT_enable_experimental_back_deploy_concurrency);
427-
428425
Opts.EnableExperimentalNamedOpaqueTypes |=
429426
Args.hasArg(OPT_enable_experimental_named_opaque_types);
430427

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,9 +1713,7 @@ void TypeChecker::checkConcurrencyAvailability(SourceRange ReferenceRange,
17131713
auto runningOS =
17141714
TypeChecker::overApproximateAvailabilityAtLocation(
17151715
ReferenceRange.Start, ReferenceDC);
1716-
auto availability = ctx.LangOpts.EnableExperimentalBackDeployConcurrency
1717-
? ctx.getBackDeployedConcurrencyAvailability()
1718-
: ctx.getConcurrencyAvailability();
1716+
auto availability = ctx.getBackDeployedConcurrencyAvailability();
17191717
if (!runningOS.isContainedIn(availability)) {
17201718
diagnosePotentialConcurrencyUnavailability(
17211719
ReferenceRange, ReferenceDC,

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ if (SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED)
2020
list(APPEND swift_stdlib_unittest_link_libraries "swift_Distributed")
2121
endif()
2222

23-
if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
24-
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
25-
else()
26-
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
27-
endif()
28-
2923
add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
3024
# This file should be listed the first. Module name is inferred from the
3125
# filename.
@@ -61,7 +55,7 @@ add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
6155
SWIFT_MODULE_DEPENDS_WINDOWS CRT WinSDK
6256
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
6357
-Xfrontend -define-availability
64-
-Xfrontend "SwiftStdlib 5.5:${swift_concurrency_availability}"
58+
-Xfrontend "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
6559
INSTALL_IN_COMPONENT stdlib-experimental
6660
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}"
6761
LINK_LIBRARIES ${swift_stdlib_unittest_link_libraries})

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
set(LLVM_OPTIONAL_SOURCES
1414
${swift_concurrency_objc_sources})
1515

16-
if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY OR BUILD_SWIFT_CONCURRENCY_BACK_DEPLOYMENT_LIBRARIES)
17-
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
18-
else()
19-
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
20-
endif()
21-
2216
if(NOT swift_concurrency_install_component)
2317
set(swift_concurrency_install_component stdlib)
2418
endif()
@@ -102,7 +96,7 @@ add_swift_target_library(swift_Concurrency ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
10296
-parse-stdlib
10397
-Xfrontend -enable-experimental-concurrency
10498
-Xfrontend -define-availability
105-
-Xfrontend "SwiftStdlib 5.5:${swift_concurrency_availability}"
99+
-Xfrontend "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
106100
LINK_FLAGS "${SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS}"
107101
${swift_concurrency_options}
108102
INSTALL_IN_COMPONENT ${swift_concurrency_install_component}

stdlib/public/Distributed/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ set(swift_distributed_link_libraries
1414
swiftCore)
1515

1616

17-
if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
18-
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
19-
else()
20-
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
21-
endif()
22-
2317
add_swift_target_library(swift_Distributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
2418
AssertDistributed.swift
2519
ActorTransport.swift
@@ -41,7 +35,7 @@ add_swift_target_library(swift_Distributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
4135
-parse-stdlib
4236
-Xfrontend -enable-experimental-distributed
4337
-Xfrontend -define-availability
44-
-Xfrontend "SwiftStdlib 5.5:${swift_concurrency_availability}"
38+
-Xfrontend "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
4539
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
4640

4741
SWIFT_MODULE_DEPENDS _Concurrency

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ normalize_boolean_spelling(SWIFT_BUILD_SYNTAXPARSERLIB)
181181
normalize_boolean_spelling(SWIFT_ENABLE_SOURCEKIT_TESTS)
182182
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
183183
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
184-
normalize_boolean_spelling(SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
184+
normalize_boolean_spelling(SWIFT_BACK_DEPLOY_CONCURRENCY)
185185
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED)
186186
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" SWIFT_OPTIMIZED)
187187

@@ -359,7 +359,7 @@ foreach(SDK ${SWIFT_SDKS})
359359
list(APPEND LIT_ARGS "--param" "concurrency")
360360
endif()
361361

362-
if(SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
362+
if(SWIFT_BACK_DEPLOY_CONCURRENCY)
363363
list(APPEND LIT_ARGS "--param" "back_deploy_concurrency")
364364
endif()
365365

test/Concurrency/concurrency_availability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %target-swift-frontend -parse-stdlib -target x86_64-apple-macosx10.14 -typecheck -verify %s
2-
// RUN: %target-swift-frontend -parse-stdlib -target x86_64-apple-macosx12 -typecheck %s
2+
// RUN: %target-swift-frontend -parse-stdlib -target x86_64-apple-macosx11 -typecheck %s
33
// REQUIRES: OS=macosx
44

55
func f() async { } // expected-error{{concurrency is only available in}}

0 commit comments

Comments
 (0)