Skip to content
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

[6.0][IRGen] Fetch the correct IGM for synthesized files #74825

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

drexin
Copy link
Contributor

@drexin drexin commented Jun 28, 2024

Explanation: Synthesized files are treated as not having a parent source file, but that can cause issues for macro code. The declarations will have the source file of their use site declared as parent source file, which means they should be emitted into the same IGM. If we don't use the correct IGM, we can get inconsistencies when referencing the generated code, which will cause linking issues.
Scope: IRGen specifically for extension macros
Issue: rdar:https://128870792
Original PR: #74717
Reviewer: @aschwaighofer
Risk: Low. Only affects extension macros and only changes the IR module they get emitted to
Test: Added a unit test that verifies the emission into the correct module

rdar:https://128870792

Synthesized files are treated as not having a parent source file, but that can cause issues for macro code. The declarations will have the source file of their use site declared as parent source file, which means they should be emitted into the same IGM. If we don't use the correct IGM, we can get inconsistencies when referencing the generated code, which will cause linking issues.
@drexin drexin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jun 28, 2024
@drexin drexin requested a review from a team as a code owner June 28, 2024 18:15
@drexin
Copy link
Contributor Author

drexin commented Jun 28, 2024

@swift-ci test

@drexin drexin changed the title [IRGen] Fetch the correct IGM for synthesized files [6.0][IRGen] Fetch the correct IGM for synthesized files Jun 29, 2024
@drexin drexin merged commit 7464aaa into swiftlang:release/6.0 Jun 29, 2024
5 checks passed
@drexin drexin deleted the wip-128870792-6.0 branch June 29, 2024 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants