-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DiagnosticsQol] Modify diagnostic macro into single DIAG #34488
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
Conversation
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.
lib/AST/DiagnosticEngine.cpp
Outdated
StoredDiagnosticInfo(DiagnosticKind::Note, DiagnosticOptions::Options), | ||
#define REMARK(ID, Options, Text, Signature) \ | ||
StoredDiagnosticInfo(DiagnosticKind::Remark, DiagnosticOptions::Options), | ||
#define DIAG(KIND, ID, Options, Text, Signature) \ |
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.
To shorten this definition we would need to capitalize all of the enum class DiagnosticKind
values like the following:
enum class DiagnosticKind : uint8_t {
ERROR,
WARNING,
REMARK,
NOTE
};
@xedin WDYT?
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.
Which means, that this would require capitalization of these in other places as well right? I mean, wherever DiagnosticKind
is referenced
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.
Naming style of the cases in enums has to stay consistent across repository. I think it's okay to just leave this as is.
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.
@xedin makes sense, I'll revert the change that I made for this then, and this will be the only case, where it will be left as is.
@swift-ci please smoke test |
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.
Thanks!
@swift-ci please smoke test |
@swift-ci please test Windows platform |
Windows is failing due to CI issues, let's try one more time and if that land anyway. |
@swift-ci please test Windows platform |
This PR addresses SR-13774, which utilizes DefineDiagnosticMacros.h to shorten macro expansion (error, warning, note, remark) into DIAG.
Resolves SR-13774.