Skip to content

Class stub fixes and execution tests #23846

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
merged 8 commits into from
Apr 19, 2019

Conversation

slavapestov
Copy link
Contributor

Fixes rdar://problem/49090613.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

return;

if (!hasObjCResilientClassStub(IGM, getType()))
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the first condition not part of what the second function checks? I could see if this is a definition-vs-use situation, but we're always at the definition site here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason I factored it so that hasObjCResilientClassStub() asserts the first condition here. I guess it makes sense to change it around.


// REQUIRES: executable_test
// REQUIRES: objc_interop
// XFAIL: *
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to make this a dynamic condition, like test/Interpreter/SDK/class_getImageName.swift?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Responded offline.

This was an oversight. I was setting the flag but not emitting the
pointer at the end.
If a class has resilient metadata from our point of view, it might
still not have a class stub, if its entire inheritance chain is
defined in a single module.

Note that inserting a superclass is still a resilient operation;
the only way to change a class from having static metadata to having
a class stub is to change it's root class, which is not something
we can do resiliently.
Fixes <rdar://49090613>, except they're disabled for the time being.
@slavapestov slavapestov force-pushed the class-stub-fix-and-tests branch from df1f47a to 7c8641c Compare April 19, 2019 21:40
@slavapestov
Copy link
Contributor Author

apple/swift-clang#301
@swift-ci Please smoke test

@slavapestov slavapestov merged commit 3bdb924 into swiftlang:master Apr 19, 2019
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