Skip to content

Emit Objective-C resilient class stubs for concrete subclasses of generic subclasses of NSObject #34766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

slavapestov
Copy link
Contributor

Fixes rdar://problem/71194117.

…) can find them

We would like it if objc_copyClassList() would find non-generic
classes with generic ancestry, as long as they ultimately inherit
from an @objc class. Make this so by emitting class stubs in a
few more cases.

Fixes <rdar://problem/71194117>.
@slavapestov slavapestov requested a review from mikeash November 16, 2020 20:11
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit e56af29 into swiftlang:main Nov 16, 2020
@xedin
Copy link
Contributor

xedin commented Nov 17, 2020

@slavapestov @shahmishal New test which has added by this PR fails on iphonesimulator-i386:

00:13:08 --
00:13:08 /Volumes/swift-ci/jenkins/workspace/oss-swift_tools-R_stdlib-RD_test-simulator/swift/test/IRGen/Inputs/Foundation.swift:110:13: warning: all paths through this function will call itself
00:13:08 public func _convertErrorToNSError(_ error: Error) -> NSError {
00:13:08             ^
00:13:08 /Volumes/swift-ci/jenkins/workspace/oss-swift_tools-R_stdlib-RD_test-simulator/swift/test/IRGen/objc_generic_class_stub.swift:17:17: error: CHECK-LABEL: expected string not found in input
00:13:08 // CHECK-LABEL: @"$s23objc_generic_class_stub24ConcreteNSObjectSubclassCMt" = internal global %objc_full_class_stub { i64 0, i64 1, %objc_class* (%objc_class*, i8*)* @"$s23objc_generic_class_stub24ConcreteNSObjectSubclassCMU" }
00:13:08                 ^
00:13:08 <stdin>:1:1: note: scanning from here
00:13:08 ; ModuleID = '<swift-imported-modules>'
00:13:08 ^
00:13:08 
00:13:08 Input file: <stdin>
00:13:08 Check file: /Volumes/swift-ci/jenkins/workspace/oss-swift_tools-R_stdlib-RD_test-simulator/swift/test/IRGen/objc_generic_class_stub.swift
00:13:08 
00:13:08 -dump-input=help explains the following input dump.
00:13:08 
00:13:08 Input was:
00:13:08 <<<<<<
00:13:08           1: ; ModuleID = '<swift-imported-modules>'
00:13:08 label:17     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
00:13:08           2: source_filename = "<swift-imported-modules>"
00:13:08 label:17     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:13:08           3: target datalayout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:128-n8:16:32-S128"
00:13:08 label:17     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:13:08           4: target triple = "i386-apple-ios7.0.0-simulator"
00:13:08 label:17     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:13:08           5: 
00:13:08 label:17     ~
00:13:08           6: %0 = type opaque
00:13:08 label:17     ~~~~~~~~~~~~~~~~
00:13:08           .
00:13:08           .
00:13:08           .
00:13:08 >>>>>>
00:13:08 
00:13:08 --
00:13:08 
00:13:08 ********************

@xedin
Copy link
Contributor

xedin commented Nov 17, 2020

This is the full test build where this PR has been included - https://ci.swift.org/job/oss-swift_tools-R_stdlib-RD_test-simulator/5642

atrick added a commit to atrick/swift that referenced this pull request Nov 17, 2020
Broken by:
Emit Objective-C resilient class stubs for concrete
subclasses of generic subclasses of NSObject swiftlang#34766
swiftlang#34766

Workaround for rdar://71476765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants