Skip to content

Commit

Permalink
Enable concurrency back-deployment in the compiler by default.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DougGregor committed Aug 29, 2021
1 parent 9d4ce58 commit 5999743
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 55 deletions.
4 changes: 0 additions & 4 deletions include/swift/Basic/LangOptions.h
Expand Up @@ -301,10 +301,6 @@ namespace swift {
/// Enable experimental concurrency model.
bool EnableExperimentalConcurrency = false;

/// Enable experimental back-deployment of the concurrency model.
bool EnableExperimentalBackDeployConcurrency =
SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY;

/// Enable experimental support for named opaque result types, e.g.
/// `func f() -> <T> T`.
bool EnableExperimentalNamedOpaqueTypes = false;
Expand Down
2 changes: 0 additions & 2 deletions include/swift/Config.h.in
Expand Up @@ -14,6 +14,4 @@

#cmakedefine01 SWIFT_ENABLE_GLOBAL_ISEL_ARM64

#cmakedefine01 SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY

#endif // SWIFT_CONFIG_H
4 changes: 0 additions & 4 deletions include/swift/Option/FrontendOptions.td
Expand Up @@ -247,10 +247,6 @@ def enable_experimental_concurrency :
Flag<["-"], "enable-experimental-concurrency">,
HelpText<"Enable experimental concurrency model">;

def enable_experimental_back_deploy_concurrency :
Flag<["-"], "enable-experimental-back-deploy-concurrency">,
HelpText<"Enable experimental back-deployment of the concurrency model">;

def enable_experimental_distributed :
Flag<["-"], "enable-experimental-distributed">,
HelpText<"Enable experimental 'distributed' actors and functions">;
Expand Down
3 changes: 0 additions & 3 deletions lib/Frontend/CompilerInvocation.cpp
Expand Up @@ -422,9 +422,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableExperimentalConcurrency |=
Args.hasArg(OPT_enable_experimental_concurrency);

Opts.EnableExperimentalBackDeployConcurrency |=
Args.hasArg(OPT_enable_experimental_back_deploy_concurrency);

Opts.EnableExperimentalNamedOpaqueTypes |=
Args.hasArg(OPT_enable_experimental_named_opaque_types);

Expand Down
4 changes: 1 addition & 3 deletions lib/Sema/TypeCheckAvailability.cpp
Expand Up @@ -1713,9 +1713,7 @@ void TypeChecker::checkConcurrencyAvailability(SourceRange ReferenceRange,
auto runningOS =
TypeChecker::overApproximateAvailabilityAtLocation(
ReferenceRange.Start, ReferenceDC);
auto availability = ctx.LangOpts.EnableExperimentalBackDeployConcurrency
? ctx.getBackDeployedConcurrencyAvailability()
: ctx.getConcurrencyAvailability();
auto availability = ctx.getBackDeployedConcurrencyAvailability();
if (!runningOS.isContainedIn(availability)) {
diagnosePotentialConcurrencyUnavailability(
ReferenceRange, ReferenceDC,
Expand Down
8 changes: 1 addition & 7 deletions stdlib/private/StdlibUnittest/CMakeLists.txt
Expand Up @@ -20,12 +20,6 @@ if (SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED)
list(APPEND swift_stdlib_unittest_link_libraries "swift_Distributed")
endif()

if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
else()
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
endif()

add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
# This file should be listed the first. Module name is inferred from the
# filename.
Expand Down Expand Up @@ -61,7 +55,7 @@ add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
SWIFT_MODULE_DEPENDS_WINDOWS CRT WinSDK
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
-Xfrontend -define-availability
-Xfrontend "SwiftStdlib 5.5:${swift_concurrency_availability}"
-Xfrontend "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
INSTALL_IN_COMPONENT stdlib-experimental
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}"
LINK_LIBRARIES ${swift_stdlib_unittest_link_libraries})
Expand Down
8 changes: 1 addition & 7 deletions stdlib/public/Concurrency/CMakeLists.txt
Expand Up @@ -13,12 +13,6 @@
set(LLVM_OPTIONAL_SOURCES
${swift_concurrency_objc_sources})

if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY OR BUILD_SWIFT_CONCURRENCY_BACK_DEPLOYMENT_LIBRARIES)
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
else()
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
endif()

if(NOT swift_concurrency_install_component)
set(swift_concurrency_install_component stdlib)
endif()
Expand Down Expand Up @@ -102,7 +96,7 @@ add_swift_target_library(swift_Concurrency ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
-parse-stdlib
-Xfrontend -enable-experimental-concurrency
-Xfrontend -define-availability
-Xfrontend "SwiftStdlib 5.5:${swift_concurrency_availability}"
-Xfrontend "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
LINK_FLAGS "${SWIFT_RUNTIME_CONCURRENCY_SWIFT_LINK_FLAGS}"
${swift_concurrency_options}
INSTALL_IN_COMPONENT ${swift_concurrency_install_component}
Expand Down
8 changes: 1 addition & 7 deletions stdlib/public/Distributed/CMakeLists.txt
Expand Up @@ -14,12 +14,6 @@ set(swift_distributed_link_libraries
swiftCore)


if (SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
set(swift_concurrency_availability "macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0")
else()
set(swift_concurrency_availability "macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0")
endif()

add_swift_target_library(swift_Distributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
AssertDistributed.swift
ActorTransport.swift
Expand All @@ -41,7 +35,7 @@ add_swift_target_library(swift_Distributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
-parse-stdlib
-Xfrontend -enable-experimental-distributed
-Xfrontend -define-availability
-Xfrontend "SwiftStdlib 5.5:${swift_concurrency_availability}"
-Xfrontend "SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0"
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"

SWIFT_MODULE_DEPENDS _Concurrency
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Expand Up @@ -181,7 +181,7 @@ normalize_boolean_spelling(SWIFT_BUILD_SYNTAXPARSERLIB)
normalize_boolean_spelling(SWIFT_ENABLE_SOURCEKIT_TESTS)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
normalize_boolean_spelling(SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
normalize_boolean_spelling(SWIFT_BACK_DEPLOY_CONCURRENCY)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED)
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" SWIFT_OPTIMIZED)

Expand Down Expand Up @@ -359,7 +359,7 @@ foreach(SDK ${SWIFT_SDKS})
list(APPEND LIT_ARGS "--param" "concurrency")
endif()

if(SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY)
if(SWIFT_BACK_DEPLOY_CONCURRENCY)
list(APPEND LIT_ARGS "--param" "back_deploy_concurrency")
endif()

Expand Down
2 changes: 1 addition & 1 deletion test/Concurrency/concurrency_availability.swift
@@ -1,5 +1,5 @@
// RUN: %target-swift-frontend -parse-stdlib -target x86_64-apple-macosx10.14 -typecheck -verify %s
// RUN: %target-swift-frontend -parse-stdlib -target x86_64-apple-macosx12 -typecheck %s
// RUN: %target-swift-frontend -parse-stdlib -target x86_64-apple-macosx11 -typecheck %s
// REQUIRES: OS=macosx

func f() async { } // expected-error{{concurrency is only available in}}
Expand Down
13 changes: 0 additions & 13 deletions test/Concurrency/concurrency_availability_back_deploy.swift

This file was deleted.

2 changes: 1 addition & 1 deletion test/lit.site.cfg.in
Expand Up @@ -134,7 +134,7 @@ if "@SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING@" == "TRUE":
config.available_features.add('differentiable_programming')
if "@SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY@" == "TRUE":
config.available_features.add('concurrency')
if "@SWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY@" == "TRUE":
if "@SWIFT_BACK_DEPLOY_CONCURRENCY@" == "TRUE":
config.available_features.add('back_deploy_concurrency')
if "@SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED@" == "TRUE":
config.available_features.add('distributed')
Expand Down
Expand Up @@ -235,7 +235,7 @@ def convert_to_impl_arguments(self):
args.extra_cmake_options.append('-DSWIFT_DISABLE_DEAD_STRIPPING:BOOL=TRUE')
if args.build_backdeployconcurrency:
args.extra_cmake_options.append(
'-DSWIFT_ALLOW_BACK_DEPLOY_CONCURRENCY:BOOL=TRUE')
'-DSWIFT_BACK_DEPLOY_CONCURRENCY:BOOL=TRUE')

# Then add subproject install flags that either skip building them /or/
# if we are going to build them and install_all is set, we also install
Expand Down

0 comments on commit 5999743

Please sign in to comment.