Skip to content

Commit 597dcd8

Browse files
committed
[Stdlib][Frontend][CMake] Remove SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT option, make it permanently on.
1 parent 65b3164 commit 597dcd8

File tree

10 files changed

+6
-36
lines changed

10 files changed

+6
-36
lines changed

Diff for: CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,6 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
250250
"Whether to enable CrashReporter integration"
251251
FALSE)
252252

253-
option(SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
254-
"Enable the Swift stable ABI's class marker bit for new deployment targets"
255-
TRUE)
256-
257253
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
258254
"The name of the toolchain to pass to 'xcrun'")
259255

Diff for: include/swift/AST/KnownIdentifiers.def

-5
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@ IDENTIFIER(stringValue)
101101
IDENTIFIER(super)
102102
IDENTIFIER(superDecoder)
103103
IDENTIFIER(superEncoder)
104-
#if SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
105104
IDENTIFIER_WITH_NAME(SwiftObject, "_TtCs12_SwiftObject")
106-
#else
107-
// Pre-stable ABI uses un-mangled name for SwiftObject.
108-
IDENTIFIER(SwiftObject)
109-
#endif
110105
IDENTIFIER(to)
111106
IDENTIFIER(toRaw)
112107
IDENTIFIER(Type)

Diff for: include/swift/Basic/LangOptions.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ namespace swift {
137137
bool EnableObjCInterop = true;
138138

139139
/// On Darwin platforms, use the pre-stable ABI's mark bit for Swift
140-
/// classes instead of the stable ABI's bit.
141-
bool UseDarwinPreStableABIBit = !bool(SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT);
140+
/// classes instead of the stable ABI's bit. This is needed when
141+
/// targeting OSes prior to macOS 10.14.4 and iOS 12.2, where
142+
/// libobjc does not support the stable ABI's marker bit.
143+
bool UseDarwinPreStableABIBit = false;
142144

143145
/// Enables checking that uses of @objc require importing
144146
/// the Foundation module.

Diff for: include/swift/Config.h.in

-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
#cmakedefine HAVE_PROC_PID_RUSAGE 1
1414

15-
#cmakedefine01 SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
16-
1715
#endif // SWIFT_CONFIG_H

Diff for: include/swift/Runtime/CMakeConfig.h.in

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#ifndef SWIFT_RUNTIME_CMAKECONFIG_H
55
#define SWIFT_RUNTIME_CMAKECONFIG_H
66

7-
#cmakedefine01 SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
87
#cmakedefine01 SWIFT_BNI_OS_BUILD
98
#cmakedefine01 SWIFT_BNI_XCODE_BUILD
109

Diff for: lib/Frontend/CompilerInvocation.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
428428
Target.isOSDarwin());
429429
Opts.EnableSILOpaqueValues |= Args.hasArg(OPT_enable_sil_opaque_values);
430430

431-
#if SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
432431
Opts.UseDarwinPreStableABIBit =
433432
(Target.isMacOSX() && Target.isMacOSXVersionLT(10, 14, 4)) ||
434433
(Target.isiOS() && Target.isOSVersionLT(12, 2)) ||
435434
(Target.isTvOS() && Target.isOSVersionLT(12, 2)) ||
436435
(Target.isWatchOS() && Target.isOSVersionLT(5, 2));
437-
#else
438-
Opts.UseDarwinPreStableABIBit = true;
439-
#endif
440436

441437
Opts.DisableConstraintSolverPerformanceHacks |=
442438
Args.hasArg(OPT_disable_constraint_solver_performance_hacks);

Diff for: lib/IRGen/GenMeta.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -2411,12 +2411,6 @@ static void emitFieldOffsetGlobals(IRGenModule &IGM,
24112411
static ClassFlags getClassFlags(ClassDecl *classDecl) {
24122412
auto flags = ClassFlags();
24132413

2414-
#if !SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
2415-
// FIXME: Remove this after enabling stable ABI.
2416-
// This bit is NOT conditioned on UseDarwinPreStableABIBit.
2417-
flags |= ClassFlags::IsSwiftPreStableABI;
2418-
#endif
2419-
24202414
// Set a flag if the class uses Swift refcounting.
24212415
auto type = classDecl->getDeclaredType()->getCanonicalType();
24222416
if (type->getReferenceCounting() == ReferenceCounting::Native) {

Diff for: stdlib/public/runtime/SwiftObject.h

-4
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@
3030

3131
#if SWIFT_OBJC_INTEROP
3232

33-
#if SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
3433
// Source code: "SwiftObject"
3534
// Real class name: mangled "Swift._SwiftObject"
3635
#define SwiftObject _TtCs12_SwiftObject
37-
#else
38-
// Pre-stable ABI uses un-mangled name for SwiftObject
39-
#endif
4036

4137
#if __has_attribute(objc_root_class)
4238
__attribute__((__objc_root_class__))

Diff for: test/Interpreter/SDK/Inputs/OldABI/OldABI.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ static void initialize(void) {
158158

159159
bool CanTestOldABI() {
160160
// These tests don't work until the stable ABI is using its designed bit.
161-
// This check can be removed after SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
162-
// is set everywhere.
161+
// This check can be removed after SWIFT_CLASS_IS_SWIFT_MASK is made
162+
// static everywhere.
163163
Class cls = objc_getClass("_TtCs19__EmptyArrayStorage");
164164
if (!cls) abort();
165165
uintptr_t *words = (uintptr_t *)cls;

Diff for: test/stdlib/Inputs/SwiftObjectNSObject/SwiftObjectNSObject.m

-6
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ void HackSwiftObject()
7474
{
7575
SwiftObjectDemangledName = "Swift._SwiftObject";
7676
Class cls = objc_getClass(SwiftObjectDemangledName);
77-
// FIXME: Remove this fallback after we enable
78-
// SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT everywhere.
79-
if (!cls) {
80-
SwiftObjectDemangledName = "SwiftObject";
81-
cls = objc_getClass(SwiftObjectDemangledName);
82-
}
8377

8478
class_addMethod(cls, @selector(perform0), (IMP)Perform0, "@@:");
8579
class_addMethod(cls, @selector(perform1:), (IMP)Perform1, "@@:@");

0 commit comments

Comments
 (0)