-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[SILGen] Fix the type of closure thunks that are passed const references #83827
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
b2c8b02
to
56ddae6
Compare
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.
I'm a little worried about the serialization changes. Are we relying on preserving Clang function types more than we were before?
56ddae6
to
13b96a1
Compare
Yes, but we need this information to properly do type lowering for closure arguments, so I do not see a way around this without a major redesign. What are your concerns? |
Just that IIRC serialization was the major thing blocking us from putting Clang types into the AST in the first place, so if we're serializing them in more places, that gives me pause. I wouldn't have expected this technical approach to require that. |
…ce structs This PR is another attempt at landing swiftlang#76903. The changes compared to the original PR: * Instead of increasing the size of SILDeclRef, store the necessary type information in a side channel using withClosureTypeInfo. * Rely on SGFContext to get the right ClangType * Extend BridgingConversion with an AbstractionPattern to store the original clang type. * The PR above introduced a crash during indexing system modules that references foreign types coming from modules imported as implementation only. These entities are implementation details so they do not need to be included during serialization. This PR adds a test and adds logic to exclude such clang types in the serialization process. rdar://131321096&141786724
13b96a1
to
f267492
Compare
@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.
LGTM
This PR is another attempt at landing #76903. The changes compared to the original PR:
rdar://131321096&141786724