Remove build infrastructure for globally enabling noncopyable types

Now that the compilation model of noncopyable types is enabled everywhere,
and one can enable the feature for specific modules, we no longer need a
separate build-script/CMake option to enable it globally. Remove it all.
This commit is contained in:
Doug Gregor
2024-03-19 13:25:29 -07:00
parent 56d207ab1a
commit 922e3daaea
13 changed files with 1 additions and 60 deletions

View File

@@ -663,10 +663,6 @@ option(SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED
"Enable experimental distributed actors and functions"
FALSE)
option(SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS
"Enable experimental NoncopyableGenerics"
FALSE)
option(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES
"Enable experimental NonescapableTypes"
FALSE)
@@ -1278,7 +1274,6 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
message(STATUS "Differentiable Programming Support: ${SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING}")
message(STATUS "Concurrency Support: ${SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY}")
message(STATUS "Distributed Support: ${SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED}")
message(STATUS "NoncopyableGenerics Support: ${SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS}")
message(STATUS "NonEscapableTypes Support: ${SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES}")
message(STATUS "String Processing Support: ${SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING}")
message(STATUS "Backtracing Support: ${SWIFT_ENABLE_BACKTRACING}")

View File

@@ -14,8 +14,6 @@
#cmakedefine01 SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED
#cmakedefine01 SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS
#cmakedefine01 SWIFT_ENABLE_GLOBAL_ISEL_ARM64
#endif // SWIFT_CONFIG_H

View File

@@ -48,11 +48,6 @@ LangOptions::LangOptions() {
// Note: Introduce default-on language options here.
// Default-on NoncopyableGenerics when the build-script setting is enabled.
if (SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS) {
Features.insert(Feature::NoncopyableGenerics);
}
// Enable any playground options that are enabled by default.
#define PLAYGROUND_OPTION(OptionName, Description, DefaultOn, HighPerfOn) \
if (DefaultOn) \

View File

@@ -175,10 +175,6 @@ option(SWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK
"Should stdlib be built with -experimental-hermetic-seal-at-link"
FALSE)
option(SWIFT_STDLIB_EXPERIMENTAL_NONCOPYABLE_GENERICS
"Should stdlib be built with NoncopyableGenerics enabled?"
TRUE)
option(SWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR
"Build stdlib without a custom implementation of MetadataAllocator, relying on malloc+free instead."
FALSE)

View File

@@ -612,9 +612,7 @@ function(_compile_swift_files
list(APPEND swift_flags "-experimental-hermetic-seal-at-link")
endif()
if(SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS OR SWIFT_STDLIB_EXPERIMENTAL_NONCOPYABLE_GENERICS)
list(APPEND swift_flags "-enable-experimental-feature" "NoncopyableGenerics")
endif()
list(APPEND swift_flags "-enable-experimental-feature" "NoncopyableGenerics")
if(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES)
list(APPEND swift_flags "-enable-experimental-feature" "NonescapableTypes")

View File

@@ -192,7 +192,6 @@ 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_ENABLE_EXPERIMENTAL_DISTRIBUTED)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING)
normalize_boolean_spelling(SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION)
@@ -407,10 +406,6 @@ foreach(SDK ${SWIFT_SDKS})
list(APPEND LIT_ARGS "--param" "distributed")
endif()
if(SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS)
list(APPEND LIT_ARGS "--param" "noncopyable_generics")
endif()
if(SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES)
list(APPEND LIT_ARGS "--param" "nonescapable_types")
endif()

View File

@@ -143,8 +143,6 @@ if "@SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY@" == "TRUE":
config.available_features.add('concurrency')
if "@SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED@" == "TRUE":
config.available_features.add('distributed')
if "@SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS@" == "TRUE":
config.available_features.add('noncopyable_generics')
if "@SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES@" == "TRUE":
config.available_features.add('nonescapable_types')
if "@SWIFT_STDLIB_STATIC_PRINT@" == "TRUE":

View File

@@ -637,8 +637,6 @@ lto
mixin-preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx
build-subdir=buildbot_incremental
enable-experimental-noncopyable-generics=1
[preset: buildbot_incremental,tools=RA,llvm-only]
build-subdir=buildbot_incremental_llvmonly

View File

@@ -1347,10 +1347,6 @@ def create_argument_parser():
default=True,
help='Enable experimental Swift distributed actors.')
option('--enable-experimental-noncopyable-generics', toggle_true,
default=False,
help='Enable experimental NoncopyableGenerics.')
option('--enable-experimental-nonescapable-types', toggle_true,
default=False,
help='Enable experimental NonescapableTypes.')

View File

@@ -168,7 +168,6 @@ EXPECTED_DEFAULTS = {
'enable_experimental_cxx_interop': True,
'enable_cxx_interop_swift_bridging_header': True,
'enable_experimental_distributed': True,
'enable_experimental_noncopyable_generics': False,
'enable_experimental_nonescapable_types': False,
'enable_experimental_string_processing': True,
'enable_experimental_observation': True,
@@ -593,7 +592,6 @@ EXPECTED_OPTIONS = [
EnableOption('--enable-experimental-cxx-interop'),
EnableOption('--enable-cxx-interop-swift-bridging-header'),
EnableOption('--enable-experimental-distributed'),
EnableOption('--enable-experimental-noncopyable-generics'),
EnableOption('--enable-experimental-nonescapable-types'),
EnableOption('--enable-experimental-string-processing'),
EnableOption('--enable-experimental-observation'),

View File

@@ -59,9 +59,6 @@ class Swift(product.Product):
# Add experimental distributed flag.
self.cmake_options.extend(self._enable_experimental_distributed)
# Add experimental NoncopyableGenerics flag.
self.cmake_options.extend(self._enable_experimental_noncopyable_generics)
# Add experimental NonescapableTypes flag.
self.cmake_options.extend(self._enable_experimental_nonescapable_types)
@@ -196,11 +193,6 @@ updated without updating swift.py?")
return [('SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL',
self.args.enable_experimental_distributed)]
@property
def _enable_experimental_noncopyable_generics(self):
return [('SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS:BOOL',
self.args.enable_experimental_noncopyable_generics)]
@property
def _enable_experimental_nonescapable_types(self):
return [('SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL',

View File

@@ -58,7 +58,6 @@ class SwiftTestCase(unittest.TestCase):
enable_experimental_cxx_interop=False,
enable_cxx_interop_swift_bridging_header=False,
enable_experimental_distributed=False,
enable_experimental_noncopyable_generics=False,
enable_experimental_nonescapable_types=False,
enable_experimental_observation=False,
swift_enable_backtracing=False,
@@ -104,7 +103,6 @@ class SwiftTestCase(unittest.TestCase):
'-DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP:BOOL=FALSE',
'-DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION:BOOL=FALSE',
'-DSWIFT_ENABLE_BACKTRACING:BOOL=FALSE',
@@ -134,7 +132,6 @@ class SwiftTestCase(unittest.TestCase):
'-DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP:BOOL=FALSE',
'-DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL=FALSE',
'-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION:BOOL=FALSE',
'-DSWIFT_ENABLE_BACKTRACING:BOOL=FALSE',
@@ -407,19 +404,6 @@ class SwiftTestCase(unittest.TestCase):
[x for x in swift.cmake_options
if 'DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED' in x])
def test_experimental_noncopyable_generics_flags(self):
self.args.enable_experimental_noncopyable_generics = True
swift = Swift(
args=self.args,
toolchain=self.toolchain,
source_dir='/path/to/src',
build_dir='/path/to/build')
self.assertEqual(
['-DSWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS:BOOL='
'TRUE'],
[x for x in swift.cmake_options
if 'DSWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS' in x])
def test_experimental_nonescapable_types_flags(self):
self.args.enable_experimental_nonescapable_types = True
swift = Swift(

View File

@@ -130,8 +130,6 @@ if "@SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY@" == "TRUE":
config.available_features.add('concurrency')
if "@SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED@" == "TRUE":
config.available_features.add('distributed')
if "@SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS@" == "TRUE":
config.available_features.add('noncopyable_generics')
if "@SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES@" == "TRUE":
config.available_features.add('nonescapable_types')
if "@SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING@" == "TRUE":