Skip to content

Commit 8033749

Browse files
committed
[clang][NFC] Annotate DiagnosticID.cpp with preferred_type
This helps debuggers to display values in bit-fields in a more helpful way.
1 parent 4bbae06 commit 8033749

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/lib/Basic/DiagnosticIDs.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const uint32_t StaticDiagInfoDescriptionOffsets[] = {
100100
};
101101

102102
// Diagnostic classes.
103-
enum {
103+
enum DiagnosticClass {
104104
CLASS_NOTE = 0x01,
105105
CLASS_REMARK = 0x02,
106106
CLASS_WARNING = 0x03,
@@ -110,15 +110,22 @@ enum {
110110

111111
struct StaticDiagInfoRec {
112112
uint16_t DiagID;
113+
LLVM_PREFERRED_TYPE(diag::Severity)
113114
uint8_t DefaultSeverity : 3;
115+
LLVM_PREFERRED_TYPE(DiagnosticClass)
114116
uint8_t Class : 3;
117+
LLVM_PREFERRED_TYPE(DiagnosticIDs::SFINAEResponse)
115118
uint8_t SFINAE : 2;
116119
uint8_t Category : 6;
120+
LLVM_PREFERRED_TYPE(bool)
117121
uint8_t WarnNoWerror : 1;
122+
LLVM_PREFERRED_TYPE(bool)
118123
uint8_t WarnShowInSystemHeader : 1;
124+
LLVM_PREFERRED_TYPE(bool)
119125
uint8_t WarnShowInSystemMacro : 1;
120126

121127
uint16_t OptionGroupIndex : 15;
128+
LLVM_PREFERRED_TYPE(bool)
122129
uint16_t Deferrable : 1;
123130

124131
uint16_t DescriptionLen;

0 commit comments

Comments
 (0)