[clang] ad27848 - [clang][NFC] Annotate `Decl.h` with `preferred_type`

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 01:18:00 PST 2023


Author: Vlad Serebrennikov
Date: 2023-11-06T12:17:53+03:00
New Revision: ad278482095242cc20f5988c25381f4586fed589

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

LOG: [clang][NFC] Annotate `Decl.h` with `preferred_type`

Added: 
    

Modified: 
    clang/include/clang/AST/Decl.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 115b08802d9a298..cd0878d7082514c 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -75,6 +75,7 @@ class TemplateParameterList;
 class TypeAliasTemplateDecl;
 class UnresolvedSetImpl;
 class VarTemplateDecl;
+enum class ImplicitParamKind;
 
 /// The top declaration context.
 class TranslationUnitDecl : public Decl,
@@ -969,12 +970,16 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
     friend class ASTDeclReader;
     friend class VarDecl;
 
+    LLVM_PREFERRED_TYPE(StorageClass)
     unsigned SClass : 3;
+    LLVM_PREFERRED_TYPE(ThreadStorageClassSpecifier)
     unsigned TSCSpec : 2;
+    LLVM_PREFERRED_TYPE(InitializationStyle)
     unsigned InitStyle : 2;
 
     /// Whether this variable is an ARC pseudo-__strong variable; see
     /// isARCPseudoStrong() for details.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned ARCPseudoStrong : 1;
   };
   enum { NumVarDeclBits = 8 };
@@ -995,22 +1000,27 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
     friend class ASTDeclReader;
     friend class ParmVarDecl;
 
+    LLVM_PREFERRED_TYPE(VarDeclBitfields)
     unsigned : NumVarDeclBits;
 
     /// Whether this parameter inherits a default argument from a
     /// prior declaration.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned HasInheritedDefaultArg : 1;
 
     /// Describes the kind of default argument for this parameter. By default
     /// this is none. If this is normal, then the default argument is stored in
     /// the \c VarDecl initializer expression unless we were unable to parse
     /// (even an invalid) expression for the default argument.
+    LLVM_PREFERRED_TYPE(DefaultArgKind)
     unsigned DefaultArgKind : 2;
 
     /// Whether this parameter undergoes K&R argument promotion.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsKNRPromoted : 1;
 
     /// Whether this parameter is an ObjC method parameter or not.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsObjCMethodParam : 1;
 
     /// If IsObjCMethodParam, a Decl::ObjCDeclQualifier.
@@ -1029,51 +1039,64 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
     friend class ImplicitParamDecl;
     friend class VarDecl;
 
+    LLVM_PREFERRED_TYPE(VarDeclBitfields)
     unsigned : NumVarDeclBits;
 
     // FIXME: We need something similar to CXXRecordDecl::DefinitionData.
     /// Whether this variable is a definition which was demoted due to
     /// module merge.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsThisDeclarationADemotedDefinition : 1;
 
     /// Whether this variable is the exception variable in a C++ catch
     /// or an Objective-C @catch statement.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned ExceptionVar : 1;
 
     /// Whether this local variable could be allocated in the return
     /// slot of its function, enabling the named return value optimization
     /// (NRVO).
+    LLVM_PREFERRED_TYPE(bool)
     unsigned NRVOVariable : 1;
 
     /// Whether this variable is the for-range-declaration in a C++0x
     /// for-range statement.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned CXXForRangeDecl : 1;
 
     /// Whether this variable is the for-in loop declaration in Objective-C.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned ObjCForDecl : 1;
 
     /// Whether this variable is (C++1z) inline.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsInline : 1;
 
     /// Whether this variable has (C++1z) inline explicitly specified.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsInlineSpecified : 1;
 
     /// Whether this variable is (C++0x) constexpr.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsConstexpr : 1;
 
     /// Whether this variable is the implicit variable for a lambda
     /// init-capture.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned IsInitCapture : 1;
 
     /// Whether this local extern variable's previous declaration was
     /// declared in the same block scope. This controls whether we should merge
     /// the type of this declaration with its previous declaration.
+    LLVM_PREFERRED_TYPE(bool)
     unsigned PreviousDeclInSameBlockScope : 1;
 
     /// Defines kind of the ImplicitParamDecl: 'this', 'self', 'vtt', '_cmd' or
     /// something else.
+    LLVM_PREFERRED_TYPE(ImplicitParamKind)
     unsigned ImplicitParamKind : 3;
 
+    LLVM_PREFERRED_TYPE(bool)
     unsigned EscapingByref : 1;
   };
 
@@ -3013,8 +3036,11 @@ class FieldDecl : public DeclaratorDecl, public Mergeable<FieldDecl> {
     ISK_CapturedVLAType,
   };
 
+  LLVM_PREFERRED_TYPE(bool)
   unsigned BitField : 1;
+  LLVM_PREFERRED_TYPE(bool)
   unsigned Mutable : 1;
+  LLVM_PREFERRED_TYPE(InitStorageKind)
   unsigned StorageKind : 2;
   mutable unsigned CachedFieldIndex : 28;
 


        


More information about the cfe-commits mailing list