-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IRGen] Reorder generic struct metadata so that field offsets follow … #14232
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 please test |
@jckarter please take a look, I'm going to try and move from pointer size to uint32_t for field offsets separately. |
Build failed |
…generic parameters Right now, field offsets come before generic arguments in instances of a struct's metadata. It would be more resilient to put the generic arguments first, since they're always used by compiler-generated code, and cannot change resiliently, unlike fields. Resolves: rdar://problem/36560486
@swift-ci please 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.
Looks good! Changing the field offsets to 32-bit as a separate patch makes sense to me.
@swift-ci please test source compatibility |
Source compatibility failed with known certificate problems, merging. |
@xedin Can you also add a test to
This test should fail before your change, because the offset at which the generic arguments are stored will change, causing failures in the after/before and before/after combinations. Also can you verify that for enums, the generic arguments are always at a fixed offset? Some enum metadata has a field for the payload size, and I don't remember if this comes before or after the generic arguments. |
@slavapestov Will do! |
…generic parameters
Right now, field offsets come before generic arguments in instances
of a struct's metadata. It would be more resilient to put the generic
arguments first, since they're always used by compiler-generated code,
and cannot change resiliently, unlike fields.
Resolves: rdar://problem/36560486