Skip to content

Commit

Permalink
[clang][NFC] Annotate DiagnosticID.cpp with preferred_type
Browse files Browse the repository at this point in the history
This helps debuggers to display values in bit-fields in a more helpful way.
  • Loading branch information
Endilll committed Feb 11, 2024
1 parent 4bbae06 commit 8033749
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion clang/lib/Basic/DiagnosticIDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const uint32_t StaticDiagInfoDescriptionOffsets[] = {
};

// Diagnostic classes.
enum {
enum DiagnosticClass {
CLASS_NOTE = 0x01,
CLASS_REMARK = 0x02,
CLASS_WARNING = 0x03,
Expand All @@ -110,15 +110,22 @@ enum {

struct StaticDiagInfoRec {
uint16_t DiagID;
LLVM_PREFERRED_TYPE(diag::Severity)
uint8_t DefaultSeverity : 3;
LLVM_PREFERRED_TYPE(DiagnosticClass)
uint8_t Class : 3;
LLVM_PREFERRED_TYPE(DiagnosticIDs::SFINAEResponse)
uint8_t SFINAE : 2;
uint8_t Category : 6;
LLVM_PREFERRED_TYPE(bool)
uint8_t WarnNoWerror : 1;
LLVM_PREFERRED_TYPE(bool)
uint8_t WarnShowInSystemHeader : 1;
LLVM_PREFERRED_TYPE(bool)
uint8_t WarnShowInSystemMacro : 1;

uint16_t OptionGroupIndex : 15;
LLVM_PREFERRED_TYPE(bool)
uint16_t Deferrable : 1;

uint16_t DescriptionLen;
Expand Down

0 comments on commit 8033749

Please sign in to comment.