-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SILGen: Forward declare SIL functions referenced by #_hasSymbol
query helpers
#61886
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
SILGen: Forward declare SIL functions referenced by #_hasSymbol
query helpers
#61886
Conversation
@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.
Super cool! I can now see how the proper layering of TBDGen could help this implementation.
@swift-ci please test Windows |
…ion generated. The query functions will be fully defined by IRGen.
…sSymbol` query functions.
…derivative(of:)` functions.
…TBDGenVisitor. This allows SILGen for `#_hasSymbol` conditions to visit them and emit a declaration of the function appropriately.
26387d4
to
38779f3
Compare
@swift-ci please smoke test and merge |
@swift-ci please smoke test macOS |
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.
Very nice!
For a
#_hasSymbol
condition check, such as the following:the compiler will generate a binary that implements something roughly equivalent to this pseudo-code:
This pull request establishes the preconditions necessary for IRGen to do its part, which is to emit the function bodies for each
#_hasSymbol
helper function required by the program. Each unique declaration that needs an associated helper function is recorded onSILModule
during SILGen and any SIL function prototypes that will be referenced by the helper function implementations are also emitted.