diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index 1c2158f51aa18..d9b00b1628ab2 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -4059,6 +4059,29 @@ class EnumDecl : public TagDecl { static bool classofKind(Kind K) { return K == Enum; } }; +/// Enum that represents the different ways arguments are passed to and +/// returned from function calls. This takes into account the target-specific +/// and version-specific rules along with the rules determined by the +/// language. +enum class ArgPassingKind { + /// The argument of this type can be passed directly in registers. + CanPassInRegs, + + /// The argument of this type cannot be passed directly in registers. + /// Records containing this type as a subobject are not forced to be passed + /// indirectly. This value is used only in C++. This value is required by + /// C++ because, in uncommon situations, it is possible for a class to have + /// only trivial copy/move constructors even when one of its subobjects has + /// a non-trivial copy/move constructor (if e.g. the corresponding copy/move + /// constructor in the derived class is deleted). + CannotPassInRegs, + + /// The argument of this type cannot be passed directly in registers. + /// Records containing this type as a subobject are forced to be passed + /// indirectly. + CanNeverPassInRegs +}; + /// Represents a struct/union/class. For example: /// struct X; // Forward declaration, no "body". /// union Y { int A, B; }; // Has body with members A and B (FieldDecls). diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 32b6aed639766..6704c0cd41ecd 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -1399,37 +1399,9 @@ enum class DeductionCandidate : unsigned char { Aggregate, }; -/// Enum that represents the different ways arguments are passed to and -/// returned from function calls. This takes into account the target-specific -/// and version-specific rules along with the rules determined by the -/// language. -enum class ArgPassingKind { - /// The argument of this type can be passed directly in registers. - CanPassInRegs, - - /// The argument of this type cannot be passed directly in registers. - /// Records containing this type as a subobject are not forced to be passed - /// indirectly. This value is used only in C++. This value is required by - /// C++ because, in uncommon situations, it is possible for a class to have - /// only trivial copy/move constructors even when one of its subobjects has - /// a non-trivial copy/move constructor (if e.g. the corresponding copy/move - /// constructor in the derived class is deleted). - CannotPassInRegs, - - /// The argument of this type cannot be passed directly in registers. - /// Records containing this type as a subobject are forced to be passed - /// indirectly. - CanNeverPassInRegs -}; - -enum class OMPDeclareReductionInitKind { - Call, // Initialized by function call. - Direct, // omp_priv() - Copy // omp_priv = -}; - -enum class ObjCImplementationControl { None, Required, Optional }; - +enum class ArgPassingKind; +enum class OMPDeclareReductionInitKind; +enum class ObjCImplementationControl; enum class LinkageSpecLanguageIDs; /// DeclContext - This is used only as base class of specific decl types that diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 2b205bee51de1..e0b31c58c39a2 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -115,6 +115,8 @@ class ObjCProtocolList : public ObjCList { const SourceLocation *Locs, ASTContext &Ctx); }; +enum class ObjCImplementationControl { None, Required, Optional }; + /// ObjCMethodDecl - Represents an instance or class method declaration. /// ObjC methods can be declared within 4 contexts: class interfaces, /// categories, protocols, and class implementations. While C++ member diff --git a/clang/include/clang/AST/DeclOpenMP.h b/clang/include/clang/AST/DeclOpenMP.h index 2bbd159f59a35..73725e6e85666 100644 --- a/clang/include/clang/AST/DeclOpenMP.h +++ b/clang/include/clang/AST/DeclOpenMP.h @@ -158,6 +158,12 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective { static bool classofKind(Kind K) { return K == OMPThreadPrivate; } }; +enum class OMPDeclareReductionInitKind { + Call, // Initialized by function call. + Direct, // omp_priv() + Copy // omp_priv = +}; + /// This represents '#pragma omp declare reduction ...' directive. /// For example, in the following, declared reduction 'foo' for types 'int' and /// 'float': diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index a15ed46cae0ee..23022d7e1a729 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -1569,66 +1569,9 @@ enum class AutoTypeKeyword { GNUAutoType }; -/// Capture whether this is a normal array (e.g. int X[4]) -/// an array with a static size (e.g. int X[static 4]), or an array -/// with a star size (e.g. int X[*]). -/// 'static' is only allowed on function parameters. -enum class ArraySizeModifier { Normal, Static, Star }; - -/// The elaboration keyword that precedes a qualified type name or -/// introduces an elaborated-type-specifier. -enum class ElaboratedTypeKeyword { - /// The "struct" keyword introduces the elaborated-type-specifier. - Struct, - - /// The "__interface" keyword introduces the elaborated-type-specifier. - Interface, - - /// The "union" keyword introduces the elaborated-type-specifier. - Union, - - /// The "class" keyword introduces the elaborated-type-specifier. - Class, - - /// The "enum" keyword introduces the elaborated-type-specifier. - Enum, - - /// The "typename" keyword precedes the qualified type name, e.g., - /// \c typename T::type. - Typename, - - /// No keyword precedes the qualified type name. - None -}; - -enum class VectorKind { - /// not a target-specific vector type - Generic, - - /// is AltiVec vector - AltiVecVector, - - /// is AltiVec 'vector Pixel' - AltiVecPixel, - - /// is AltiVec 'vector bool ...' - AltiVecBool, - - /// is ARM Neon vector - Neon, - - /// is ARM Neon polynomial vector - NeonPoly, - - /// is AArch64 SVE fixed-length data vector - SveFixedLengthData, - - /// is AArch64 SVE fixed-length predicate vector - SveFixedLengthPredicate, - - /// is RISC-V RVV fixed-length data vector - RVVFixedLengthData, -}; +enum class ArraySizeModifier; +enum class ElaboratedTypeKeyword; +enum class VectorKind; /// The base class of the type hierarchy. /// @@ -3145,6 +3088,12 @@ class MemberPointerType : public Type, public llvm::FoldingSetNode { } }; +/// Capture whether this is a normal array (e.g. int X[4]) +/// an array with a static size (e.g. int X[static 4]), or an array +/// with a star size (e.g. int X[*]). +/// 'static' is only allowed on function parameters. +enum class ArraySizeModifier { Normal, Static, Star }; + /// Represents an array type, per C99 6.7.5.2 - Array Declarators. class ArrayType : public Type, public llvm::FoldingSetNode { private: @@ -3474,6 +3423,34 @@ class DependentSizedExtVectorType : public Type, public llvm::FoldingSetNode { QualType ElementType, Expr *SizeExpr); }; +enum class VectorKind { + /// not a target-specific vector type + Generic, + + /// is AltiVec vector + AltiVecVector, + + /// is AltiVec 'vector Pixel' + AltiVecPixel, + + /// is AltiVec 'vector bool ...' + AltiVecBool, + + /// is ARM Neon vector + Neon, + + /// is ARM Neon polynomial vector + NeonPoly, + + /// is AArch64 SVE fixed-length data vector + SveFixedLengthData, + + /// is AArch64 SVE fixed-length predicate vector + SveFixedLengthPredicate, + + /// is RISC-V RVV fixed-length data vector + RVVFixedLengthData, +}; /// Represents a GCC generic vector type. This type is created using /// __attribute__((vector_size(n)), where "n" specifies the vector size in @@ -5667,6 +5644,32 @@ class InjectedClassNameType : public Type { } }; +/// The elaboration keyword that precedes a qualified type name or +/// introduces an elaborated-type-specifier. +enum class ElaboratedTypeKeyword { + /// The "struct" keyword introduces the elaborated-type-specifier. + Struct, + + /// The "__interface" keyword introduces the elaborated-type-specifier. + Interface, + + /// The "union" keyword introduces the elaborated-type-specifier. + Union, + + /// The "class" keyword introduces the elaborated-type-specifier. + Class, + + /// The "enum" keyword introduces the elaborated-type-specifier. + Enum, + + /// The "typename" keyword precedes the qualified type name, e.g., + /// \c typename T::type. + Typename, + + /// No keyword precedes the qualified type name. + None +}; + /// The kind of a tag type. enum TagTypeKind { /// The "struct" keyword.