IRGen: Perform completely fragile layout for all classes, not just @objc ancestry [4.2 6/11] #17211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: In 4.2 we enabled resilience for value types. If a class has fields of resilient type the class metadata has to be initialized dynamically since the size of those fields is not known. Dynamic initialization of this form is not supported by the Objective-C runtime. We added a workaround so that classes with @objc ancestry bypass resilience when doing layout, allowing them to be referenced from Objective-C code. However classes without @objc ancestry can also have Objective-C categories and Objective-C protocol conformances. So broaden the workaround for all classes when Objective-C interop is enabled.
Scope of the issue: Reported by users testing beta 1.
Origination: New in 4.2.
Tested: Existing test change changed to have a non-NSObject subclass.
Risk: Low, the existing workaround is already known to work in the wild.
Radar: Fixes rdar://problem/40819319
Reviewed by: @jckarter