Skip to content

IRGen: fix and re-enable static read-only arrays #62226

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

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Nov 22, 2022

Static read-only arrays didn't work when passed to ObjectiveC as NSArray. The storage class of static read-only arrays doesn't carry information about the Element type. The new __SwiftDeferredStaticNSArray is generic over the element type and doesn't have to rely on the element type information of the array storage.

This is a follow-up of #59612

rdar://94185998

@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

Copy link
Contributor

@Catfish-Man Catfish-Man left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, sorry, didn't see this until now. I think the bridging buffer stuff has some issues, but they're not new in this code, so we'll fix them whenever we fix the existing bits (I don't know what specifically is wrong, I just have some reports that suggest it may be).

Looks good in general!

@eeckstein eeckstein force-pushed the read-only-static-arrays branch from 45c525a to b73539a Compare December 21, 2022 08:15
@eeckstein eeckstein force-pushed the read-only-static-arrays branch from b73539a to 54ba147 Compare December 12, 2023 13:05
Static read-only arrays didn't work when passed to ObjectiveC as NSArray.
The storage class of static read-only arrays doesn't carry information about the Element type.
The new `__SwiftDeferredStaticNSArray` is generic over the element type and doesn't have to rely on the element type information of the array storage.

rdar://94185998
@eeckstein eeckstein force-pushed the read-only-static-arrays branch from 54ba147 to e4ea749 Compare December 13, 2023 10:46
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit 295b6ac into swiftlang:main Dec 13, 2023
@eeckstein eeckstein deleted the read-only-static-arrays branch December 13, 2023 15:44
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.

4 participants