-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Add fix for corner case where NS_OPTIONS typedef has to be desugared #66619
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
[cxx-interop] Add fix for corner case where NS_OPTIONS typedef has to be desugared #66619
Conversation
b241346
to
21a3c89
Compare
@egorzhdan Can I get a quick review and test run? |
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.
A few small comments but approach looks good. Thanks, Puyan!
@plotfi do you not have commit access? |
@swift-ci please test |
I do but I don’t think I have CI access. |
Can you ping @shahmishal? |
@plotfi you should have access let me know if you can't start it. |
Thanks @shahmishal for confirming! |
21a3c89
to
82fe5e3
Compare
… be desugared This patch is an add-on to swiftlang#64043. Essentially when encountering NS_OPTIONS enums, in C++-Interop mode if they are not specially handled then they can mangle differently than they do without C++-Interop. This patch adds logic to handle when a typedef and enum have additional clang::ElaboratedType sugar, but otherwise it does the same as the existing 64043 patch. The test case provided was encountered in a real app build. The problem came from when two modules are each compiled one with and one without C++-Interop. For the test case code provided the mangling of the protocol conformance is not consistent and the code in SILGenLazyConformance.cpp crashes on an invalid conformance with reason "Invalid conformance in type-checked AST".
82fe5e3
to
fe6ccd7
Compare
@swift-ci please test |
@NuriAmari added code to do consistent mangling for NS_OPTIONS types in the context of C++-Interop, but I think with UIControlState we have a corner case where the typedef has surgar in the form of a clang::ElaboratedType.
Still trying to get the specifics right on this one and will add test cases soon. This does fix the mangling for the case in #66602
Commit Message: