-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[DiagnosticVerifier] improve output for expansions in clang attributes #85528
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
base: main
Are you sure you want to change the base?
Conversation
|
@swift-ci please smoke test |
3ed143c to
26fb12b
Compare
|
Updated [DiagnosticVerifier] don't repeat diagnostics in other files and [DiagnosticVerifier] ensure expansion ancestors are populated with their respective test failures |
|
@swift-ci please smoke test |
...-verify-additional-file It's not expected that users add macro expansion buffer names to -verify-additional-file. The recommended approach is to add the actual source file that the macro was expanded in, and use expected-expansion.
This won't affect diagnostic printing, as the diagnostic engine checks the GeneratedSourceInfoKind and stops expanding if it's an AttributeFromClang kind. This helps the diagnostic verifier expand to the original location in source code however.
This makes it more explicit and consistent, which are good properties for test output. It makes it easier both for humans and update-verify-tests to see what exactly is going on. This does not affect how diagnostics are displayed to users normally.
`verifyUnknown()` and `verifyUnrelated()` would not remove the diagnostics after reporting their errors, leading to the same diagnostics then being emitted a second time. This removes them from the list after emitting them, just like `verifyFile()` does.
Simply GSI->ancestors is not enough if the ancestors list has not been populated yet. Ensure this is done by calling getAncestors.
26fb12b to
69f6f47
Compare
|
Updated each commit with |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test windows platform |
1 similar comment
|
@swift-ci please smoke test windows platform |
This adds
test/Frontend/DiagnosticVerifier/clang-attribute.swift, and then makes a series of improvements to the output.I recommend reviewing commit by commit.