Skip to content

Commit 9de7b59

Browse files
authored
Subsume SWIFT_STDLIB_USE_NONATOMIC_RC into SWIFT_STDLIB_SINGLE_THREADED_RUNTIME (#33643)
1 parent 9ee8cd2 commit 9de7b59

16 files changed

+15
-44
lines changed

stdlib/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,10 @@ option(SWIFT_RUNTIME_MACHO_NO_DYLD
2121
"Build stdlib assuming the runtime environment uses Mach-O but does not support dynamic modules."
2222
FALSE)
2323

24-
option(SWIFT_STDLIB_USE_NONATOMIC_RC
25-
"Build the standard libraries and overlays with nonatomic reference count operations enabled"
26-
FALSE)
27-
2824
option(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME
29-
"Build the standard libraries assuming that they will be used in an environment with only a single thread. If set, also forces SWIFT_STDLIB_USE_NONATOMIC_RC to On."
25+
"Build the standard libraries assuming that they will be used in an environment with only a single thread."
3026
FALSE)
3127

32-
if(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME)
33-
set(SWIFT_STDLIB_USE_NONATOMIC_RC TRUE)
34-
endif()
35-
3628
#
3729
# End of user-configurable options.
3830
#

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,6 @@ function(_add_target_variant_c_compile_flags)
306306
list(APPEND result "-DSWIFT_RUNTIME_MACHO_NO_DYLD")
307307
endif()
308308

309-
if(SWIFT_STDLIB_USE_NONATOMIC_RC)
310-
list(APPEND result "-DSWIFT_STDLIB_USE_NONATOMIC_RC")
311-
endif()
312-
313309
if(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME)
314310
list(APPEND result "-DSWIFT_STDLIB_SINGLE_THREADED_RUNTIME")
315311
endif()

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ function(_compile_swift_files
404404
list(APPEND swift_flags "-enable-library-evolution")
405405
endif()
406406

407-
if(SWIFT_STDLIB_USE_NONATOMIC_RC)
407+
if(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME)
408408
list(APPEND swift_flags "-Xfrontend" "-assume-single-threaded")
409409
endif()
410410

stdlib/public/runtime/MetadataImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ template <class Impl, class T> struct RetainableBoxBase {
136136
static constexpr size_t stride = sizeof(T);
137137
static constexpr bool isPOD = false;
138138
static constexpr bool isBitwiseTakable = true;
139-
#ifdef SWIFT_STDLIB_USE_NONATOMIC_RC
139+
#ifdef SWIFT_STDLIB_SINGLE_THREADED_RUNTIME
140140
static constexpr bool isAtomic = false;
141141
#else
142142
static constexpr bool isAtomic = true;

test/lit.site.cfg.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ if "@SWIFT_AST_VERIFIER@" == "TRUE":
8787
if "@SWIFT_OPTIMIZED@" == "TRUE":
8888
config.available_features.add("optimized_stdlib")
8989

90-
if "@SWIFT_STDLIB_USE_NONATOMIC_RC@" == "TRUE":
91-
config.available_features.add("nonatomic_rc")
90+
if "@SWIFT_STDLIB_SINGLE_THREADED_RUNTIME@" == "TRUE":
91+
config.available_features.add("single_threaded_runtime")
9292

9393
if "@SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS@" == "TRUE":
9494
config.available_features.add('runtime_function_counters')

utils/build-presets.ini

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -212,21 +212,6 @@ skip-test-ios-simulator
212212
skip-test-tvos-simulator
213213
skip-test-watchos-simulator
214214

215-
[preset: buildbot,tools=RA,stdlib=RD,single-thread]
216-
mixin-preset=
217-
mixin_buildbot_tools_RA_stdlib_RD
218-
219-
dash-dash
220-
221-
# Enable non-atomic build of the stdlib
222-
swift-stdlib-use-nonatomic-rc=true
223-
224-
# Don't run host tests for iOS, tvOS and watchOS platforms to make the build
225-
# faster.
226-
skip-test-ios-host
227-
skip-test-tvos-host
228-
skip-test-watchos-host
229-
230215
[preset: buildbot,tools=R,stdlib=RD]
231216
mixin-preset=
232217
mixin_buildbot_tools_R_stdlib_RD

utils/build-script-impl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ KNOWN_SETTINGS=(
186186
swift-primary-variant-sdk "" "default SDK for target binaries"
187187
swift-runtime-enable-leak-checker "0" "Enable leaks checking routines in the runtime"
188188
swift-stdlib-enable-assertions "1" "enable assertions in Swift"
189-
swift-stdlib-use-nonatomic-rc "0" "build the Swift stdlib and overlays with nonatomic reference count operations enabled"
190189
swift-tools-enable-lto "" "enable LTO compilation of Swift tools. *NOTE* This does not include the swift standard library and runtime. Must be set to one of 'thin' or 'full'"
191190
extra-swift-args "" "Extra arguments to pass to swift modules which match regex. Assumed to be a flattened cmake list consisting of [module_regexp, args, module_regexp, args, ...]"
192191
report-statistics "0" "set to 1 to generate compilation statistics files for swift libraries"
@@ -1755,7 +1754,6 @@ for host in "${ALL_HOSTS[@]}"; do
17551754
-DSWIFT_ANALYZE_CODE_COVERAGE:STRING=$(toupper "${SWIFT_ANALYZE_CODE_COVERAGE}")
17561755
-DSWIFT_STDLIB_BUILD_TYPE:STRING="${SWIFT_STDLIB_BUILD_TYPE}"
17571756
-DSWIFT_STDLIB_ASSERTIONS:BOOL=$(true_false "${SWIFT_STDLIB_ENABLE_ASSERTIONS}")
1758-
-DSWIFT_STDLIB_USE_NONATOMIC_RC:BOOL=$(true_false "${SWIFT_STDLIB_USE_NONATOMIC_RC}")
17591757
-DSWIFT_ENABLE_COMPATIBILITY_OVERRIDES:BOOL=$(true_false "${SWIFT_ENABLE_COMPATIBILITY_OVERRIDES}")
17601758
-DSWIFT_STDLIB_SINGLE_THREADED_RUNTIME:BOOL=$(true_false "${SWIFT_STDLIB_SINGLE_THREADED_RUNTIME}")
17611759
-DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS:BOOL=$(true_false "${SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS}")

validation-test/Runtime/weak-reference-racetests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-run-simple-swift
22
// REQUIRES: executable_test
33
// REQUIRES: stress_test
4-
// UNSUPPORTED: nonatomic_rc
4+
// UNSUPPORTED: single_threaded_runtime
55

66
import StdlibUnittest
77

validation-test/SILOptimizer/string_switch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
55
// REQUIRES: stress_test
66
// REQUIRES: executable_test
7-
// UNSUPPORTED: nonatomic_rc
7+
// UNSUPPORTED: single_threaded_runtime
88

99
import StdlibUnittest
1010

validation-test/StdlibUnittest/AtomicInt.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %target-run %t.out
55
// REQUIRES: executable_test
66
// REQUIRES: stress_test
7-
// UNSUPPORTED: nonatomic_rc
7+
// UNSUPPORTED: single_threaded_runtime
88

99
import SwiftPrivate
1010
import StdlibUnittest

validation-test/StdlibUnittest/RaceTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-build-swift -Xfrontend -disable-access-control -module-name a %s -o %t.out
33
// RUN: %target-run %t.out | %FileCheck %s
44
// REQUIRES: stress_test
5-
// UNSUPPORTED: nonatomic_rc
5+
// UNSUPPORTED: single_threaded_runtime
66

77
import SwiftPrivate
88
import StdlibUnittest

validation-test/lit.site.cfg.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ if "@SWIFT_OPTIMIZED@" == "TRUE":
8787
if "@SWIFT_ENABLE_SOURCEKIT_TESTS@" == "TRUE":
8888
config.available_features.add('sourcekit')
8989

90-
if "@SWIFT_STDLIB_USE_NONATOMIC_RC@" == "TRUE":
91-
config.available_features.add("nonatomic_rc")
90+
if "@SWIFT_STDLIB_SINGLE_THREADED_RUNTIME@" == "TRUE":
91+
config.available_features.add("single_threaded_runtime")
9292

9393
if "@SWIFT_BUILT_STANDALONE@" == "TRUE":
9494
config.available_features.add('standalone_build')

validation-test/stdlib/ArrayBridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// REQUIRES: objc_interop
1010
// REQUIRES: executable_test
1111
// REQUIRES: stress_test
12-
// UNSUPPORTED: nonatomic_rc
12+
// UNSUPPORTED: single_threaded_runtime
1313

1414
import StdlibUnittest
1515
import Foundation

validation-test/stdlib/CommandLine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// RUN: %target-run %t/CommandLineStressTest foo bar baz qux quux corge grault garply waldo fred plugh xyzzy and thud
99
// REQUIRES: executable_test
1010
// REQUIRES: stress_test
11-
// UNSUPPORTED: nonatomic_rc
11+
// UNSUPPORTED: single_threaded_runtime
1212

1313
// This file is an empty stub to call into the command line stress test which
1414
// houses `main`.

validation-test/stdlib/DictionaryBridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// REQUIRES: stress_test
99

1010
// REQUIRES: objc_interop
11-
// UNSUPPORTED: nonatomic_rc
11+
// UNSUPPORTED: single_threaded_runtime
1212

1313
import StdlibUnittest
1414
import Foundation

validation-test/stdlib/ErrorProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// REQUIRES: executable_test
33
// REQUIRES: stress_test
44
// REQUIRES: objc_interop
5-
// UNSUPPORTED: nonatomic_rc
5+
// UNSUPPORTED: single_threaded_runtime
66

77
import SwiftPrivate
88
import StdlibUnittest

0 commit comments

Comments
 (0)