-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Fix compiler crash when importing non-public members with -g #80485
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4a88a4a
to
d78c77d
Compare
@swift-ci please test |
d78c77d
to
6b6eb28
Compare
@swift-ci please test |
6b6eb28
to
a3eaa34
Compare
@swift-ci please test |
Xazax-hun
approved these changes
Apr 4, 2025
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.
Good question what is going on on the Windows build bot but the change itself looks good to me.
a3eaa34
to
2bfe95e
Compare
egorzhdan
approved these changes
Apr 4, 2025
@swift-ci please test |
2bfe95e
to
3bb3794
Compare
hnrklssn
reviewed
Apr 6, 2025
fahadnayyar
approved these changes
Apr 6, 2025
When generating debug symbols for private Clang types (which we started importing recently), the compiler crashes due to an assertion failure from ClangModuleUnit::getDiscriminatorForPrivateDecl(), which is called by getFilePrivateScope(). This patch fixes the issue crash by not calling getFilePrivateScope() for Clang types types. A discriminator is usually needed to disambiguate private Swift types declared in different files, but Clang types follow different scoping conventions that make this discriminator unnecessary. rdar://148481025
3bb3794
to
db1dc9f
Compare
@swift-ci please test |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please test |
j-hui
added a commit
to j-hui/swift
that referenced
this pull request
Apr 10, 2025
swiftlang#80485) When generating debug symbols for private Clang types (which we started importing recently), the compiler crashes due to an assertion failure from ClangModuleUnit::getDiscriminatorForPrivateDecl(), which is called by getFilePrivateScope(). This patch fixes the issue crash by not calling getFilePrivateScope() for Clang types. A discriminator is usually needed to disambiguate private Swift types declared in different files, but Clang types follow different scoping conventions that make this discriminator unnecessary. rdar://148481025 (cherry picked from commit dd2f465)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Importing private members while the compiler is passed the
-g
flag causes an assertion to be tripped. This patch fixes it.This PR is stacked on top of #80515, which introduces a new test case (without changing the compiler itself). This PR includes adds
-g
to that test case.rdar://148481025