Skip to content

Commit 520997e

Browse files
Merge pull request #65540 from aschwaighofer/revert_guard_using_clang_for_objc_protocols_by_deploy_target
Revert "Merge pull request #65516 from aschwaighofer/guard_using_clang_for_objc_protocols_by_deploy_target"
2 parents b454112 + f403e55 commit 520997e

File tree

6 files changed

+6
-21
lines changed

6 files changed

+6
-21
lines changed

Diff for: lib/IRGen/GenClass.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -2719,17 +2719,7 @@ llvm::Constant *irgen::emitObjCProtocolData(IRGenModule &IGM,
27192719
ProtocolDecl *proto) {
27202720
assert(proto->isObjC() && "not an objc protocol");
27212721
PrettyStackTraceDecl stackTraceRAII("emitting ObjC metadata for", proto);
2722-
2723-
// The linker on older deployment targets does not gracefully handle the
2724-
// situation when both an objective c object and a swift object define the
2725-
// protocol under the same symbol name.
2726-
auto deploymentAvailability =
2727-
AvailabilityContext::forDeploymentTarget(IGM.Context);
2728-
bool canUseClangEmission = deploymentAvailability.isContainedIn(
2729-
IGM.Context.getSwift58Availability());
2730-
2731-
if (llvm::Triple(IGM.Module.getTargetTriple()).isOSDarwin() &&
2732-
canUseClangEmission) {
2722+
if (llvm::Triple(IGM.Module.getTargetTriple()).isOSDarwin()) {
27332723
// Use the clang to generate the protocol metadata if there is a clang node.
27342724
if (auto clangDecl = proto->getClangDecl()) {
27352725
if (auto objcMethodDecl = dyn_cast<clang::ObjCProtocolDecl>(clangDecl)) {

Diff for: test/Concurrency/objc_async_protocol_irgen.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -target %target-swift-abi-5.8-triple -import-objc-header %S/Inputs/Delegate.h %s -emit-ir -o - | %FileCheck %s -DALIGNMENT=%target-alignment --check-prefix=CHECK-%is-darwin
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -import-objc-header %S/Inputs/Delegate.h %s -emit-ir -o - | %FileCheck %s -DALIGNMENT=%target-alignment --check-prefix=CHECK-%is-darwin
22
// REQUIRES: concurrency
33
// REQUIRES: objc_interop
44

Diff for: test/IRGen/generic_casts.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %build-irgen-test-overlays
3-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -primary-file %s -emit-ir -enable-objc-interop -disable-objc-attr-requires-foundation-module -target %target-swift-abi-5.8-triple | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-os
3+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -primary-file %s -emit-ir -enable-objc-interop -disable-objc-attr-requires-foundation-module | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-os
44

55
// REQUIRES: CPU=x86_64
66

Diff for: test/IRGen/objc_protocols.swift

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %build-irgen-test-overlays
33
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -o %t %S/Inputs/objc_protocols_Bas.swift
4-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -primary-file %s -emit-ir -disable-objc-attr-requires-foundation-module -target %target-swift-abi-5.8-triple > %t/out.ir
5-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -primary-file %s -emit-ir -disable-objc-attr-requires-foundation-module -target %target-swift-abi-5.7-triple > %t/out.old.ir
4+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -primary-file %s -emit-ir -disable-objc-attr-requires-foundation-module > %t/out.ir
65
// RUN: %FileCheck --input-file=%t/out.ir %s --check-prefix=CHECK --check-prefix=CHECK-%target-os
7-
// RUN: %FileCheck --input-file=%t/out.old.ir %s --check-prefix=CHECK-OLD --check-prefix=CHECK-%target-os-OLD
86

97
// REQUIRES: PTRSIZE=64
108
// REQUIRES: objc_interop
@@ -125,8 +123,6 @@ class ImplementingClass : InheritingProtocol { }
125123

126124
// CHECK-linux: @_PROTOCOL_PROTOCOLS_NSDoubleInheritedFunging = weak hidden constant{{.*}}i64 2{{.*}} @_PROTOCOL_NSFungingAndRuncing {{.*}}@_PROTOCOL_NSFunging
127125
// CHECK-macosx: @"_OBJC_$_PROTOCOL_REFS_NSDoubleInheritedFunging" = internal global{{.*}}i64 2{{.*}} @"_OBJC_PROTOCOL_$_NSFungingAndRuncing"{{.*}} @"_OBJC_PROTOCOL_$_NSFunging"
128-
// CHECK-linux-OLD: @_PROTOCOL_PROTOCOLS_NSDoubleInheritedFunging = weak hidden constant{{.*}}i64 2{{.*}} @_PROTOCOL_NSFungingAndRuncing {{.*}}@_PROTOCOL_NSFunging
129-
// CHECK-macosx-OLD: @_PROTOCOL_PROTOCOLS_NSDoubleInheritedFunging = weak hidden constant{{.*}} @_PROTOCOL_NSFungingAndRuncing
130126

131127
// -- Force generation of witness for Zim.
132128
// CHECK: define hidden swiftcc { %objc_object*, i8** } @"$s14objc_protocols22mixed_heritage_erasure{{[_0-9a-zA-Z]*}}F"
@@ -136,7 +132,6 @@ func mixed_heritage_erasure(_ x: Zim) -> Frungible {
136132
// CHECK: insertvalue { %objc_object*, i8** } [[T0]], i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* [[ZIM_FRUNGIBLE_WITNESS]], i32 0, i32 0), 1
137133
}
138134

139-
// CHECK-OLD-LABEL: define hidden swiftcc void @"$s14objc_protocols0A8_generic{{[_0-9a-zA-Z]*}}F"(%objc_object* %0, %swift.type* %T) {{.*}} {
140135
// CHECK-LABEL: define hidden swiftcc void @"$s14objc_protocols0A8_generic{{[_0-9a-zA-Z]*}}F"(%objc_object* %0, %swift.type* %T) {{.*}} {
141136
func objc_generic<T : NSRuncing>(_ x: T) {
142137
x.runce()

Diff for: test/IRGen/objc_type_encoding.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %build-irgen-test-overlays
3-
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir -disable-objc-attr-requires-foundation-module -target %target-swift-abi-5.8-triple | %FileCheck %s -check-prefix=CHECK-%target-os
3+
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir -disable-objc-attr-requires-foundation-module | %FileCheck %s -check-prefix=CHECK-%target-os
44

55
// REQUIRES: CPU=x86_64
66
// REQUIRES: objc_interop

Diff for: validation-test/IRGen/issue-49393.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -target %target-swift-abi-5.8-triple -emit-ir %s -module-name M -import-objc-header %S/Inputs/issue-49393.h | %FileCheck %s --check-prefix=CHECK-%is-darwin --check-prefix=CHECK
1+
// RUN: %target-swift-frontend -emit-ir %s -module-name M -import-objc-header %S/Inputs/issue-49393.h | %FileCheck %s --check-prefix=CHECK-%is-darwin --check-prefix=CHECK
22
// REQUIRES: objc_interop
33

44
// https://github.com/apple/swift/issues/49393

0 commit comments

Comments
 (0)