Skip to content

[lldb] Handle formatting C anonymous struct and unions in Swift #7850

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
Jan 18, 2024

Conversation

augusto2112
Copy link

TypeSystemSwiftTypeRef handles Clang types by looking them up in debug information. This doesn't work for anonymous structs and unions, as:

  1. they don't have a mangled name emitted in debug information
  2. it's not possible to differentiate between multiple sibling anonymous structs/unions inside the same parent type.

For these reasons, when encountering an anonymous type, return the clang type directly, instead of trying to convert it to Swift.

rdar://96453293

@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test

Copy link

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

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

The code LGTM! I just feel like this test should also work in Linux?

TypeSystemSwiftTypeRef handles Clang types by looking them up in debug
information. This doesn't work for anonymous structs and unions, as:
1) they don't have a mangled name emitted in debug information
2) it's not possible to differentiate between multiple sibling
   anonymous structs/unions inside the same parent type.

For these reasons, when encountering an anonymous type, return the clang
type directly, instead of trying to convert it to Swift.

rdar://96453293
@augusto2112
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link

@swift-ci test windows

@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link

@swift-ci test

@augusto2112 augusto2112 merged commit 0d46a6c into swiftlang:stable/20230725 Jan 18, 2024
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.

3 participants