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