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

[IRGen] Fetch the correct IGM for synthesized files #74717

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

drexin
Copy link
Contributor

@drexin drexin commented Jun 25, 2024

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
Copy link
Contributor Author

drexin commented Jun 25, 2024

@swift-ci smoke test

@drexin drexin force-pushed the wip-128870792 branch 2 times, most recently from 3d2e079 to ad5e72f Compare June 26, 2024 15:59
@drexin drexin changed the title [AST] Handle synthesized files in DeclContext::getParentSourceFile [IRGen] Fetch the correct IGM for synthesized files Jun 26, 2024
@drexin
Copy link
Contributor Author

drexin commented Jun 26, 2024

@swift-ci smoke test

@drexin
Copy link
Contributor Author

drexin commented Jun 26, 2024

@swift-ci smoke test

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
Copy link
Contributor Author

drexin commented Jun 28, 2024

@swift-ci smoke test

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@drexin
Copy link
Contributor Author

drexin commented Jun 29, 2024

@swift-ci smoke test

@drexin drexin merged commit b7c241d into swiftlang:main Jun 29, 2024
3 checks passed
@drexin drexin deleted the wip-128870792 branch June 29, 2024 14:33
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.

None yet

2 participants