[clang] [llvm] [clang] Deduplicate builtin diagnostic descriptions (PR #202624)

David Zbarsky via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 17:48:46 PDT 2026


================
@@ -111,25 +79,26 @@ struct StaticDiagInfoRec {
   uint16_t WarnNoWerror : 1;
   LLVM_PREFERRED_TYPE(bool)
   uint16_t WarnShowInSystemHeader : 1;
+  LLVM_PREFERRED_TYPE(diag::Group)
+  uint16_t OptionGroupIndex : 14;
   LLVM_PREFERRED_TYPE(bool)
   uint16_t WarnShowInSystemMacro : 1;
-
-  LLVM_PREFERRED_TYPE(diag::Group)
-  uint16_t OptionGroupIndex : 15;
   LLVM_PREFERRED_TYPE(bool)
   uint16_t Deferrable : 1;
 
-  uint16_t DescriptionLen;
+  uint16_t DescriptionOffsetLow;
----------------
dzbarsky wrote:

I added : 16 to DescriptionOffsetLow, so the three description fields form one 32-bit bit-field group. I kept uint16_t as the base type because using uint32_t makes StaticDiagInfoRec 4-byte aligned and increases it from 10 to 12 bytes.

https://github.com/llvm/llvm-project/pull/202624


More information about the cfe-commits mailing list