1//===--- TypeTraits.h - C++ Type Traits Support Enumerations ----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// Defines enumerations for the type traits support.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_BASIC_TYPETRAITS_H
15#define LLVM_CLANG_BASIC_TYPETRAITS_H
16
17namespace clang {
18
19 /// Names for traits that operate specifically on types.
20 enum TypeTrait {
21 UTT_HasNothrowAssign,
22 UTT_HasNothrowMoveAssign,
23 UTT_HasNothrowCopy,
24 UTT_HasNothrowConstructor,
25 UTT_HasTrivialAssign,
26 UTT_HasTrivialMoveAssign,
27 UTT_HasTrivialCopy,
28 UTT_HasTrivialDefaultConstructor,
29 UTT_HasTrivialMoveConstructor,
30 UTT_HasTrivialDestructor,
31 UTT_HasVirtualDestructor,
32 UTT_IsAbstract,
33 UTT_IsAggregate,
34 UTT_IsArithmetic,
35 UTT_IsArray,
36 UTT_IsClass,
37 UTT_IsCompleteType,
38 UTT_IsCompound,
39 UTT_IsConst,
40 UTT_IsDestructible,
41 UTT_IsEmpty,
42 UTT_IsEnum,
43 UTT_IsFinal,
44 UTT_IsFloatingPoint,
45 UTT_IsFunction,
46 UTT_IsFundamental,
47 UTT_IsIntegral,
48 UTT_IsInterfaceClass,
49 UTT_IsLiteral,
50 UTT_IsLvalueReference,
51 UTT_IsMemberFunctionPointer,
52 UTT_IsMemberObjectPointer,
53 UTT_IsMemberPointer,
54 UTT_IsNothrowDestructible,
55 UTT_IsObject,
56 UTT_IsPOD,
57 UTT_IsPointer,
58 UTT_IsPolymorphic,
59 UTT_IsReference,
60 UTT_IsRvalueReference,
61 UTT_IsScalar,
62 UTT_IsSealed,
63 UTT_IsSigned,
64 UTT_IsStandardLayout,
65 UTT_IsTrivial,
66 UTT_IsTriviallyCopyable,
67 UTT_IsTriviallyDestructible,
68 UTT_IsUnion,
69 UTT_IsUnsigned,
70 UTT_IsVoid,
71 UTT_IsVolatile,
72 UTT_HasUniqueObjectRepresentations,
73 UTT_Last = UTT_HasUniqueObjectRepresentations,
74 BTT_IsBaseOf,
75 BTT_IsConvertible,
76 BTT_IsConvertibleTo,
77 BTT_IsSame,
78 BTT_TypeCompatible,
79 BTT_IsAssignable,
80 BTT_IsNothrowAssignable,
81 BTT_IsTriviallyAssignable,
82 BTT_ReferenceBindsToTemporary,
83 BTT_Last = BTT_ReferenceBindsToTemporary,
84 TT_IsConstructible,
85 TT_IsNothrowConstructible,
86 TT_IsTriviallyConstructible
87 };
88
89 /// Names for the array type traits.
90 enum ArrayTypeTrait {
91 ATT_ArrayRank,
92 ATT_ArrayExtent
93 };
94
95 /// Names for the "expression or type" traits.
96 enum UnaryExprOrTypeTrait {
97 UETT_SizeOf,
98 /// Used for C's _Alignof and C++'s alignof.
99 /// _Alignof and alignof return the required ABI alignment.
100 UETT_AlignOf,
101 UETT_VecStep,
102 UETT_OpenMPRequiredSimdAlign,
103 /// Used for GCC's __alignof.
104 /// __alignof returns the preferred alignment of a type, the alignment
105 /// clang will attempt to give an object of the type if allowed by ABI.
106 UETT_PreferredAlignOf,
107 };
108}
109
110#endif
111