[clang] [clang][NFC] Add LLVM_PREFERRED_TYPE to EvaluatedStmt bitfields (PR #205026)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 21 20:54:06 PDT 2026


https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/205026

None

>From 7b1bd16a6b15e81e366421bac5c02da9ab9346f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Mon, 22 Jun 2026 05:52:44 +0200
Subject: [PATCH] [clang][NFC] Add LLVM_PREFERRED_TYPE to EvaluatedStmt
 bitfields

---
 clang/include/clang/AST/Decl.h | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index e0623d0cb324d..e200b8f06ec4b 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -884,31 +884,39 @@ class DeclaratorDecl : public ValueDecl {
 /// is an integral constant expression (if known).
 struct EvaluatedStmt {
   /// Whether this statement was already evaluated.
-  bool WasEvaluated : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned WasEvaluated : 1;
 
   /// Whether this statement is being evaluated.
-  bool IsEvaluating : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned IsEvaluating : 1;
 
   /// Whether this variable is known to have constant initialization. This is
   /// currently only computed in C++, for static / thread storage duration
   /// variables that might have constant initialization and for variables that
   /// are usable in constant expressions.
-  bool HasConstantInitialization : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasConstantInitialization : 1;
 
   /// Whether this variable is known to have constant destruction. That is,
   /// whether running the destructor on the initial value is a side-effect
   /// (and doesn't inspect any state that might have changed during program
   /// execution). This is currently only computed if the destructor is
   /// non-trivial.
-  bool HasConstantDestruction : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasConstantDestruction : 1;
 
   /// In C++98, whether the initializer is an ICE. This affects whether the
   /// variable is usable in constant expressions.
-  bool HasICEInit : 1;
-  bool CheckedForICEInit : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasICEInit : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned CheckedForICEInit : 1;
 
-  bool HasSideEffects : 1;
-  bool CheckedForSideEffects : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasSideEffects : 1;
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned CheckedForSideEffects : 1;
 
   LazyDeclStmtPtr Value;
   APValue Evaluated;



More information about the cfe-commits mailing list