Skip to content

Fix SILDebugScopes for closures expanded from an expression macro. #65742

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
May 7, 2023

Conversation

adrian-prantl
Copy link
Contributor

An expression macro can expand not just to code inside the function, but also to a closure. Such a closure needs to be treated similar to any functions generated from a freestanding macro: Its instructions should have locations that point straight into the macro buffer. Instructions that are expanded into the same function as the macro expansion can be represented using inline locations pointing back to the macro expansion, but this is not an option for top-level function declaration.

#65484
rdar://108618562
(cherry picked from commit 00b24c9)

An expression macro can expand not just to code inside the function, but also to
a closure. Such a closure needs to be treated similar to any functions generated
from a freestanding macro: Its instructions should have locations that point
straight into the macro buffer. Instructions that are expanded into the same
function as the macro expansion can be represented using inline locations
pointing back to the macro expansion, but this is not an option for top-level
function declaration.

swiftlang#65484
rdar://108618562
(cherry picked from commit 00b24c9)
@adrian-prantl adrian-prantl requested a review from a team as a code owner May 6, 2023 16:26
@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 6156351 into swiftlang:release/5.9 May 7, 2023
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.

2 participants