-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Emit objc type encoding for ivars #81967
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
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although I'm not the one to judge IRGen style or logic.
@swift-ci test macOS |
d108509
to
2ddbb6b
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
@rjmccall the code I'm changing was authored by you, although that was 12 years ago. Tagging you in case you have feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Would you be interested in also fixing the TODOs about putting these in a proper section? I think this is just a matter of generalizing the useOSLogSection
parameter on getAddrOfGlobalString
to an enum.
Actually, there's an existing enum for this, ObjCLabelType
. It probably ought to be renamed to StringLiteralKind
and given an explicit CString
enumerator, but it all looks pretty straightforward.
On further testing, this needs changes for bridged types. A property declared NSString and defined as String, cannot use an encoding of My initial plan is to use |
@swift-ci test |
@swift-ci test macOS |
@mikeash I've made a change here around bridged types such as |
Looks right to me. The type isn't representable in this form so |
17499e4
to
a469626
Compare
a469626
to
bf2dd29
Compare
@swift-ci test |
@swift-ci test macOS |
ObjC ivar metadata has up to now emitted an empty string for the ivar's objc type encoding. Conversely, ObjC property metadata is emitted with an objc type encoding. This changes the compiler to also emit an objc type encoding for ivars.
The motivation for this change is for lldb to print ivars of classes declared in Objective-C but implemented in Swift, as defined in SE-0436. Without the presence of type encoding for ivars, lldb is unable to present to the user the ivars/properties of instances of such classes.
rdar://138569299