aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/Basic/Specifiers.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/Basic/Specifiers.h76
1 files changed, 46 insertions, 30 deletions
diff --git a/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h b/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h
index 82b3c1f3c274..87f29c8ae10b 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h
+++ b/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h
@@ -19,6 +19,9 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
+namespace llvm {
+class raw_ostream;
+} // namespace llvm
namespace clang {
/// Define the meaning of possible values of the kind in ExplicitSpecifier.
@@ -31,7 +34,7 @@ namespace clang {
/// Define the kind of constexpr specifier.
enum class ConstexprSpecKind { Unspecified, Constexpr, Consteval, Constinit };
- /// In an if statement, this denotes whether the the statement is
+ /// In an if statement, this denotes whether the statement is
/// a constexpr or consteval if statement.
enum class IfStatementKind : unsigned {
Ordinary,
@@ -53,41 +56,44 @@ namespace clang {
TST_unspecified,
TST_void,
TST_char,
- TST_wchar, // C++ wchar_t
- TST_char8, // C++20 char8_t (proposed)
- TST_char16, // C++11 char16_t
- TST_char32, // C++11 char32_t
+ TST_wchar, // C++ wchar_t
+ TST_char8, // C++20 char8_t (proposed)
+ TST_char16, // C++11 char16_t
+ TST_char32, // C++11 char32_t
TST_int,
TST_int128,
- TST_bitint, // Bit-precise integer types.
- TST_half, // OpenCL half, ARM NEON __fp16
- TST_Float16, // C11 extension ISO/IEC TS 18661-3
- TST_Accum, // ISO/IEC JTC1 SC22 WG14 N1169 Extension
+ TST_bitint, // Bit-precise integer types.
+ TST_half, // OpenCL half, ARM NEON __fp16
+ TST_Float16, // C11 extension ISO/IEC TS 18661-3
+ TST_Accum, // ISO/IEC JTC1 SC22 WG14 N1169 Extension
TST_Fract,
TST_BFloat16,
TST_float,
TST_double,
TST_float128,
TST_ibm128,
- TST_bool, // _Bool
- TST_decimal32, // _Decimal32
- TST_decimal64, // _Decimal64
- TST_decimal128, // _Decimal128
+ TST_bool, // _Bool
+ TST_decimal32, // _Decimal32
+ TST_decimal64, // _Decimal64
+ TST_decimal128, // _Decimal128
TST_enum,
TST_union,
TST_struct,
- TST_class, // C++ class type
- TST_interface, // C++ (Microsoft-specific) __interface type
- TST_typename, // Typedef, C++ class-name or enum name, etc.
- TST_typeofType,
- TST_typeofExpr,
- TST_decltype, // C++11 decltype
- TST_underlyingType, // __underlying_type for C++11
- TST_auto, // C++11 auto
- TST_decltype_auto, // C++1y decltype(auto)
- TST_auto_type, // __auto_type extension
- TST_unknown_anytype, // __unknown_anytype extension
- TST_atomic, // C11 _Atomic
+ TST_class, // C++ class type
+ TST_interface, // C++ (Microsoft-specific) __interface type
+ TST_typename, // Typedef, C++ class-name or enum name, etc.
+ TST_typeofType, // C23 (and GNU extension) typeof(type-name)
+ TST_typeofExpr, // C23 (and GNU extension) typeof(expression)
+ TST_typeof_unqualType, // C23 typeof_unqual(type-name)
+ TST_typeof_unqualExpr, // C23 typeof_unqual(expression)
+ TST_decltype, // C++11 decltype
+#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) TST_##Trait,
+#include "clang/Basic/TransformTypeTraits.def"
+ TST_auto, // C++11 auto
+ TST_decltype_auto, // C++1y decltype(auto)
+ TST_auto_type, // __auto_type extension
+ TST_unknown_anytype, // __unknown_anytype extension
+ TST_atomic, // C11 _Atomic
#define GENERIC_IMAGE_TYPE(ImgType, Id) TST_##ImgType##_t, // OpenCL image types
#include "clang/Basic/OpenCLImageTypes.def"
TST_error // erroneous type
@@ -96,10 +102,14 @@ namespace clang {
/// Structure that packs information about the type specifiers that
/// were written in a particular type specifier sequence.
struct WrittenBuiltinSpecs {
- static_assert(TST_error < 1 << 6, "Type bitfield not wide enough for TST");
- /*DeclSpec::TST*/ unsigned Type : 6;
- /*DeclSpec::TSS*/ unsigned Sign : 2;
- /*TypeSpecifierWidth*/ unsigned Width : 2;
+ static_assert(TST_error < 1 << 7, "Type bitfield not wide enough for TST");
+ LLVM_PREFERRED_TYPE(TypeSpecifierType)
+ unsigned Type : 7;
+ LLVM_PREFERRED_TYPE(TypeSpecifierSign)
+ unsigned Sign : 2;
+ LLVM_PREFERRED_TYPE(TypeSpecifierWidth)
+ unsigned Width : 2;
+ LLVM_PREFERRED_TYPE(bool)
unsigned ModeAttr : 1;
};
@@ -280,6 +290,9 @@ namespace clang {
CC_PreserveMost, // __attribute__((preserve_most))
CC_PreserveAll, // __attribute__((preserve_all))
CC_AArch64VectorCall, // __attribute__((aarch64_vector_pcs))
+ CC_AArch64SVEPCS, // __attribute__((aarch64_sve_pcs))
+ CC_AMDGPUKernelCall, // __attribute__((amdgpu_kernel))
+ CC_M68kRTD, // __attribute__((m68k_rtd))
};
/// Checks whether the given calling convention supports variadic
@@ -296,6 +309,7 @@ namespace clang {
case CC_OpenCLKernel:
case CC_Swift:
case CC_SwiftAsync:
+ case CC_M68kRTD:
return false;
default:
return true;
@@ -324,10 +338,12 @@ namespace clang {
Unspecified,
// Generally behaves like Nullable, except when used in a block parameter
// that was imported into a swift async method. There, swift will assume
- // that the parameter can get null even if no error occured. _Nullable
+ // that the parameter can get null even if no error occurred. _Nullable
// parameters are assumed to only get null on error.
NullableResult,
};
+ /// Prints human-readable debug representation.
+ llvm::raw_ostream &operator<<(llvm::raw_ostream&, NullabilityKind);
/// Return true if \p L has a weaker nullability annotation than \p R. The
/// ordering is: Unspecified < Nullable < NonNull.