-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ClangImporter: teach clang importer to import Clang SPI symbols and model them similarly as Swift SPIs #39068
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 smoke test |
The Objective-C logic for these macros is far from ideal. Instead of bringing it over to Swift could we type-check this as part of the TypeCheckAccess logic and plug this into |
Yeah, I think we could set a bit here and actually diagnose in |
9a66626
to
a1158b1
Compare
@swift-ci please smoke test |
@xymus The approach I implemented was slightly different: (1) an |
@swift-ci Please smoke test OS X platform |
@swift-ci Please smoke test OS X platform |
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.
This looks good!
Should we wait for library-level inference in the build system to land before we integrate this? I'm worried that as such it will raise false positive on SPI use in private frameworks.
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.
As discussed offline, the change in debug info behavior is a regression.
@swift-ci please smoke test |
@swift-ci please smoke 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 like you were able fix the missing ImportDecls, thanks!
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
…odel them similarly as Swift SPIs For clang symbols marked with SPI_AVAILABLE, we add SPIAccessControlAttr to them so they will be considered as SPIs in the AST. To be able to use all these symbols, we also add an implicit SPI import statement for all clang modules. All clang SPIs belong to the same SPI group named "OBJC_DEFUALT_SPI_GROUP" because clang currently doesn't support custom SPI group. rdar://73902734
@swift-ci please smoke test |
@xymus @adrian-prantl Thanks for taking a look! All tests passed. Merging. |
For clang symbols marked with SPI_AVAILABLE, we add SPIAccessControlAttr to them so they will be considered as SPIs in the AST. To be able to use all these symbols, we also add an implicit SPI import statement for all clang modules. All clang SPIs belong to the same SPI group named
<objc>
because clang currently doesn't support custom SPI group.rdar://73902734