-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Serialize SIL witness-tables and v-tables if package cmo is enabled. #72606
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 |
1a445b9
to
f523041
Compare
@swift-ci smoke test |
f523041
to
8c8bff4
Compare
@swift-ci smoke test |
8c8bff4
to
32fda75
Compare
@swift-ci smoke test |
auto accessLevelToCheck = | ||
optInPackage ? AccessLevel::Package : AccessLevel::Public; | ||
|
||
if (conformance->getProtocol()->getEffectiveAccess() < accessLevelToCheck) |
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.
Without this, witness thunks for conformance with package linkage don't get proper linkages in SILGenConformance::addMethodImplementation(..); they are defaulted to private
otherwise and an attempt to serialize during package-cmo would lead to an assert fail.
32fda75
to
12571f5
Compare
acd9a4f
to
bb70268
Compare
@swift-ci smoke test |
Unrelated to your PR. But I noticed something in the following code:
The first time we call the
This seems to be an oversight/ unnecessary pessimistic. I think we should change the code to:
|
…e cmo is enabled. If two modules are in the same package and package cmo is enabled, v-table or witness-table calls should not be generated at the use site in the client module. Modified conformance serialization check to allow serializing witness thunks. Also reordered SIL functions bottom-up so the most nested referenced functions can be serialized first. Allowed serializing a function if a shared definition (e.g. function `print`). Added a check for resilient mode wrt struct instructions. Added tests for SIL tables and resilient mode on/off. rdar://124632670
bb70268
to
c44b22a
Compare
@swift-ci smoke 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
Serialize SIL witness-tables and v-tables and their entries if package cmo is
enabled. If two modules are in the same package and package cmo is enabled,
v-table or witness-table calls should not be generated at the use site in the
client module. Modified conformance serialization check to allow serializing
witness thunks.
Also reordered SIL functions bottom-up so the most nested referenced functions
can be serialized first. Allowed serializing a function if it's a shared definition
(e.g. function
print
). Added a check for resilient modes and loadable types.Added tests for SIL tables and resilient mode on/off.
rdar://124632670