Skip to content

[IRGen] Correctly emit metadata for ObjC class properties #2011

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

Merged

Conversation

jrose-apple
Copy link
Contributor

...which is important because Clang CodeGen was already claiming we were!

Follow-up to 50e3b33. Resolves rdar://problem/25473573.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

@jrose-apple
Copy link
Contributor Author

@gparker42, mind reviewing?

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

fields.push_back(buildPropertyList());
fields[5] = buildPropertyList(ForClass);
// const property_list_t *classProperties;
fields[6] = buildPropertyList(ForMetaClass);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added a uint32_t size = sizeof(category_t) field here (rdar://24804226).

@gparker42
Copy link
Contributor

Where are the objc image info flags set? There is a new one to indicate the presence of this data.

Looks good other than the image info flags and the new category_t.size field.

@jrose-apple
Copy link
Contributor Author

Clang is setting them for us, se we've just been broken for the last few weeks. Oops.

Is there a good way to test that that doesn't depend on updates to the ObjC runtime?

We rely on Clang to set these properly now. No functionality change.
@jrose-apple jrose-apple force-pushed the objc-class-property-metadata branch from fb2b77e to 3f020ab Compare April 4, 2016 19:36
@gparker42
Copy link
Contributor

You can write a runtime test for class properties on class objects, at least, because the old runtime happens to handle them correctly. Check the result of class_getProperty(object_getClass([YourClass class]), "Your PropertyName").

@jrose-apple
Copy link
Contributor Author

Better than nothing. Thanks, Greg.

...which is important because Clang CodeGen was already claiming we were!

rdar://problem/25473573
@jrose-apple jrose-apple force-pushed the objc-class-property-metadata branch from 3f020ab to 4dd3c10 Compare April 5, 2016 02:27
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple merged commit e144a58 into swiftlang:master Apr 5, 2016
@jrose-apple jrose-apple deleted the objc-class-property-metadata branch April 5, 2016 16:07
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.

2 participants