Skip to content

[lldb] Use canonical QualTypes to determine SwiftOptionSet formatter eligibility #7975

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

Michael137
Copy link

@Michael137 Michael137 commented Jan 13, 2024

When we lookup a clang type from DWARF by name, we use the first one we find. In this test we have two entities with the name ComparisonResult, en enum and a typedef to the enum. So if we happened to find the typedef first, we would fail to apply the OptionSet formatter to it because it explicitly wants a QualType whose type-class is an enum.

This fixes lang/swift/enum_objc/TestEnumObjC.py when using the new FindTypes TypeQuery APIs (see
#7885)

The fix simply gets the canonical type before we check its type-class.

@Michael137
Copy link
Author

@swift-ci test

1 similar comment
@Michael137
Copy link
Author

@swift-ci test

@Michael137
Copy link
Author

@swift-ci test Windows

…eligibility

When we lookup a clang type from DWARF by name, we
use the first one we find. In this test we have two
entities with the name `ComparisonResult`, en enum
and a typedef to the enum. So if we happened to find
the typedef first, we would fail to apply the `OptionSet`
formatter to it because it explicitly wants a QualType
whose type-class is an enum.

This fixes `lang/swift/enum_objc/TestEnumObjC.py` when applying
using the new `FindTypes` `TypeQuery` APIs (see
swiftlang#7885)

The fix simply gets the canonical type before we check
its type-class.
@Michael137
Copy link
Author

@swift-ci test

@Michael137
Copy link
Author

@swift-ci test Windows

@Michael137 Michael137 force-pushed the bugfix/lldb-optionset-desugar-to-next branch from f7364b5 to 2e77345 Compare January 18, 2024 10:45
@Michael137 Michael137 merged commit 8b09d88 into swiftlang:next 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.

2 participants