Skip to content

Conversation

eeckstein
Copy link
Contributor

This is not required anymore to be able to unarchive such classes (before the first object of the class is instantiated).

rdar://problem/37568342

@eeckstein
Copy link
Contributor Author

@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
Copy link
Contributor

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.

Copy link
Contributor Author

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
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test and merge

1 similar comment
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test and merge

@jrose-apple
Copy link
Contributor

It's actually an exact check of what classes should be included here.

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.

@swift-ci swift-ci merged commit cfebd83 into swiftlang:master Feb 17, 2018
@eeckstein
Copy link
Contributor Author

It's a check of what classes we expect to need force-initialization, but it doesn't check that the others actually don't.

It also checks that, because it uses CHECK-NEXT. So there is an exact check of the list of classes which are eagerly initialized.

That is, we have nothing that checks that nested classes don't fail, because the tests always encode and then decode.

The test is compiled 2 times. And the decoder does not encode, i.e. does not initialize the class before reading the archive.

@jrose-apple
Copy link
Contributor

It's a check of what classes we expect to need force-initialization, but it doesn't check that the others actually don't.

It also checks that, because it uses CHECK-NEXT. So there is an exact check of the list of classes which are eagerly initialized.

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.

@eeckstein eeckstein deleted the nested-classes-md branch April 17, 2021 15:03
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