[clang] 8033749 - [clang][NFC] Annotate `DiagnosticID.cpp` with `preferred_type`

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 11 04:49:08 PST 2024


Author: Vlad Serebrennikov
Date: 2024-02-11T15:48:52+03:00
New Revision: 803374994602910aae2cb483d03bcbdb294b21bb

URL: https://github.com/llvm/llvm-project/commit/803374994602910aae2cb483d03bcbdb294b21bb
DIFF: https://github.com/llvm/llvm-project/commit/803374994602910aae2cb483d03bcbdb294b21bb.diff

LOG: [clang][NFC] Annotate `DiagnosticID.cpp` with `preferred_type`

This helps debuggers to display values in bit-fields in a more helpful way.

Added: 
    

Modified: 
    clang/lib/Basic/DiagnosticIDs.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index 6c7bd50eefb7ef..b353a6627f298b 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -100,7 +100,7 @@ const uint32_t StaticDiagInfoDescriptionOffsets[] = {
 };
 
 // Diagnostic classes.
-enum {
+enum DiagnosticClass {
   CLASS_NOTE       = 0x01,
   CLASS_REMARK     = 0x02,
   CLASS_WARNING    = 0x03,
@@ -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;


        


More information about the cfe-commits mailing list