-
Notifications
You must be signed in to change notification settings - Fork 10.5k
NSArchive support: don't eagerly create class metadata for nested classes. #14681
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 smoke test |
@@ -176,3 +177,13 @@ func main() { | |||
|
|||
main() | |||
|
|||
// Check that we only eagerly create metadata of generic classes. | |||
|
|||
// CHECK-IR-LABEL: define {{.*}} @_swift_eager_class_initialization |
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.
I'd be happier if you had a positive check here as well, that all the other classes have static symbols emitted for them.
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.
It's actually and exact check of what classes should be included here.
…sses. This is not required anymore to be able to unarchive such classes (before the first object of the class is instantiated). rdar://problem/37568342
4efaf4e
to
2a7c958
Compare
@swift-ci smoke test and merge |
1 similar comment
@swift-ci smoke test and merge |
It's a check of what classes we expect to need force-initialization, but it doesn't check that the others actually don't. That is, we have nothing that checks that nested classes don't fail, because the tests always encode and then decode. |
It also checks that, because it uses CHECK-NEXT. So there is an exact check of the list of classes which are eagerly initialized.
The test is compiled 2 times. And the decoder does not encode, i.e. does not initialize the class before reading the archive. |
Sorry for being ambiguous. It does check that the other classes are not force-initialized. However, it does not check that the other classes do not need to be force-initialized, i.e. that they have static symbols the ObjC runtime can find. …but I missed that the test was compiled twice. I thought it was a StdlibUnittest test for some reason. |
This is not required anymore to be able to unarchive such classes (before the first object of the class is instantiated).
rdar://problem/37568342