Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/clang/AST/BuiltinTypes.def is written in an unsupported language. File is not indexed.

0001 //===-- BuiltinTypes.def - Metadata about BuiltinTypes ----------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 //  This file defines the database about various builtin singleton types.
0010 //
0011 //  BuiltinType::Id is the enumerator defining the type.
0012 //
0013 //  Context.SingletonId is the global singleton of this type.  Some global
0014 //  singletons are shared by multiple types.
0015 //
0016 //    BUILTIN_TYPE(Id, SingletonId) - A builtin type that has not been
0017 //    covered by any other #define.  Defining this macro covers all
0018 //    the builtins.
0019 //
0020 //    SIGNED_TYPE(Id, SingletonId) - A signed integral type.
0021 //
0022 //    UNSIGNED_TYPE(Id, SingletonId) - An unsigned integral type.
0023 //
0024 //    FLOATING_TYPE(Id, SingletonId) - A floating-point type.
0025 //
0026 //    PLACEHOLDER_TYPE(Id, SingletonId) - A placeholder type.  Placeholder
0027 //    types are used to perform context-sensitive checking of specific
0028 //    forms of expression.
0029 //
0030 //    SHARED_SINGLETON_TYPE(Expansion) - The given expansion corresponds
0031 //    to a builtin which uses a shared singleton type.
0032 //
0033 //===----------------------------------------------------------------------===//
0034 
0035 #ifndef SIGNED_TYPE
0036 #define SIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
0037 #endif
0038 
0039 #ifndef UNSIGNED_TYPE
0040 #define UNSIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
0041 #endif
0042 
0043 #ifndef FLOATING_TYPE
0044 #define FLOATING_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
0045 #endif
0046 
0047 #ifndef PLACEHOLDER_TYPE
0048 #define PLACEHOLDER_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
0049 #endif
0050 
0051 #ifndef SHARED_SINGLETON_TYPE
0052 #define SHARED_SINGLETON_TYPE(Expansion) Expansion
0053 #endif
0054 
0055 //===- Builtin Types ------------------------------------------------------===//
0056 
0057 // void
0058 BUILTIN_TYPE(Void, VoidTy)
0059 
0060 //===- Unsigned Types -----------------------------------------------------===//
0061 
0062 // 'bool' in C++, '_Bool' in C99
0063 UNSIGNED_TYPE(Bool, BoolTy)
0064 
0065 // 'char' for targets where it's unsigned
0066 SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(Char_U, CharTy))
0067 
0068 // 'unsigned char', explicitly qualified
0069 UNSIGNED_TYPE(UChar, UnsignedCharTy)
0070 
0071 // 'wchar_t' for targets where it's unsigned
0072 SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(WChar_U, WCharTy))
0073 
0074 // 'char8_t' in C++20 (proposed)
0075 UNSIGNED_TYPE(Char8, Char8Ty)
0076 
0077 // 'char16_t' in C++
0078 UNSIGNED_TYPE(Char16, Char16Ty)
0079 
0080 // 'char32_t' in C++
0081 UNSIGNED_TYPE(Char32, Char32Ty)
0082 
0083 // 'unsigned short'
0084 UNSIGNED_TYPE(UShort, UnsignedShortTy)
0085 
0086 // 'unsigned int'
0087 UNSIGNED_TYPE(UInt, UnsignedIntTy)
0088 
0089 // 'unsigned long'
0090 UNSIGNED_TYPE(ULong, UnsignedLongTy)
0091 
0092 // 'unsigned long long'
0093 UNSIGNED_TYPE(ULongLong, UnsignedLongLongTy)
0094 
0095 // '__uint128_t'
0096 UNSIGNED_TYPE(UInt128, UnsignedInt128Ty)
0097 
0098 //===- Signed Types -------------------------------------------------------===//
0099 
0100 // 'char' for targets where it's signed
0101 SHARED_SINGLETON_TYPE(SIGNED_TYPE(Char_S, CharTy))
0102 
0103 // 'signed char', explicitly qualified
0104 SIGNED_TYPE(SChar, SignedCharTy)
0105 
0106 // 'wchar_t' for targets where it's signed
0107 SHARED_SINGLETON_TYPE(SIGNED_TYPE(WChar_S, WCharTy))
0108 
0109 // 'short' or 'signed short'
0110 SIGNED_TYPE(Short, ShortTy)
0111 
0112 // 'int' or 'signed int'
0113 SIGNED_TYPE(Int, IntTy)
0114 
0115 // 'long' or 'signed long'
0116 SIGNED_TYPE(Long, LongTy)
0117 
0118 // 'long long' or 'signed long long'
0119 SIGNED_TYPE(LongLong, LongLongTy)
0120 
0121 // '__int128_t'
0122 SIGNED_TYPE(Int128, Int128Ty)
0123 
0124 //===- Fixed point types --------------------------------------------------===//
0125 
0126 // 'short _Accum'
0127 SIGNED_TYPE(ShortAccum, ShortAccumTy)
0128 
0129 // '_Accum'
0130 SIGNED_TYPE(Accum, AccumTy)
0131 
0132 // 'long _Accum'
0133 SIGNED_TYPE(LongAccum, LongAccumTy)
0134 
0135 // 'unsigned short _Accum'
0136 UNSIGNED_TYPE(UShortAccum, UnsignedShortAccumTy)
0137 
0138 // 'unsigned _Accum'
0139 UNSIGNED_TYPE(UAccum, UnsignedAccumTy)
0140 
0141 // 'unsigned long _Accum'
0142 UNSIGNED_TYPE(ULongAccum, UnsignedLongAccumTy)
0143 
0144 // 'short _Fract'
0145 SIGNED_TYPE(ShortFract, ShortFractTy)
0146 
0147 // '_Fract'
0148 SIGNED_TYPE(Fract, FractTy)
0149 
0150 // 'long _Fract'
0151 SIGNED_TYPE(LongFract, LongFractTy)
0152 
0153 // 'unsigned short _Fract'
0154 UNSIGNED_TYPE(UShortFract, UnsignedShortFractTy)
0155 
0156 // 'unsigned _Fract'
0157 UNSIGNED_TYPE(UFract, UnsignedFractTy)
0158 
0159 // 'unsigned long _Fract'
0160 UNSIGNED_TYPE(ULongFract, UnsignedLongFractTy)
0161 
0162 // '_Sat short _Accum'
0163 SIGNED_TYPE(SatShortAccum, SatShortAccumTy)
0164 
0165 // '_Sat _Accum'
0166 SIGNED_TYPE(SatAccum, SatAccumTy)
0167 
0168 // '_Sat long _Accum'
0169 SIGNED_TYPE(SatLongAccum, SatLongAccumTy)
0170 
0171 // '_Sat unsigned short _Accum'
0172 UNSIGNED_TYPE(SatUShortAccum, SatUnsignedShortAccumTy)
0173 
0174 // '_Sat unsigned _Accum'
0175 UNSIGNED_TYPE(SatUAccum, SatUnsignedAccumTy)
0176 
0177 // '_Sat unsigned long _Accum'
0178 UNSIGNED_TYPE(SatULongAccum, SatUnsignedLongAccumTy)
0179 
0180 // '_Sat short _Fract'
0181 SIGNED_TYPE(SatShortFract, SatShortFractTy)
0182 
0183 // '_Sat _Fract'
0184 SIGNED_TYPE(SatFract, SatFractTy)
0185 
0186 // '_Sat long _Fract'
0187 SIGNED_TYPE(SatLongFract, SatLongFractTy)
0188 
0189 // '_Sat unsigned short _Fract'
0190 UNSIGNED_TYPE(SatUShortFract, SatUnsignedShortFractTy)
0191 
0192 // '_Sat unsigned _Fract'
0193 UNSIGNED_TYPE(SatUFract, SatUnsignedFractTy)
0194 
0195 // '_Sat unsigned long _Fract'
0196 UNSIGNED_TYPE(SatULongFract, SatUnsignedLongFractTy)
0197 
0198 //===- Floating point types -----------------------------------------------===//
0199 
0200 // 'half' in OpenCL, '__fp16' in ARM NEON.
0201 FLOATING_TYPE(Half, HalfTy)
0202 
0203 // 'float'
0204 FLOATING_TYPE(Float, FloatTy)
0205 
0206 // 'double'
0207 FLOATING_TYPE(Double, DoubleTy)
0208 
0209 // 'long double'
0210 FLOATING_TYPE(LongDouble, LongDoubleTy)
0211 
0212 // '_Float16'
0213 FLOATING_TYPE(Float16, HalfTy)
0214 
0215 // '__bf16'
0216 FLOATING_TYPE(BFloat16, BFloat16Ty)
0217 
0218 // '__float128'
0219 FLOATING_TYPE(Float128, Float128Ty)
0220 
0221 // '__ibm128'
0222 FLOATING_TYPE(Ibm128, Ibm128Ty)
0223 
0224 //===- Language-specific types --------------------------------------------===//
0225 
0226 // This is the type of C++0x 'nullptr'.
0227 BUILTIN_TYPE(NullPtr, NullPtrTy)
0228 
0229 // The primitive Objective C 'id' type.  The user-visible 'id'
0230 // type is a typedef of an ObjCObjectPointerType to an
0231 // ObjCObjectType with this as its base.  In fact, this only ever
0232 // shows up in an AST as the base type of an ObjCObjectType.
0233 BUILTIN_TYPE(ObjCId, ObjCBuiltinIdTy)
0234 
0235 // The primitive Objective C 'Class' type.  The user-visible
0236 // 'Class' type is a typedef of an ObjCObjectPointerType to an
0237 // ObjCObjectType with this as its base.  In fact, this only ever
0238 // shows up in an AST as the base type of an ObjCObjectType.
0239 BUILTIN_TYPE(ObjCClass, ObjCBuiltinClassTy)
0240 
0241 // The primitive Objective C 'SEL' type.  The user-visible 'SEL'
0242 // type is a typedef of a PointerType to this.
0243 BUILTIN_TYPE(ObjCSel, ObjCBuiltinSelTy)
0244 
0245 // OpenCL sampler_t.
0246 BUILTIN_TYPE(OCLSampler, OCLSamplerTy)
0247 
0248 // OpenCL event_t.
0249 BUILTIN_TYPE(OCLEvent, OCLEventTy)
0250 
0251 // OpenCL clk_event_t.
0252 BUILTIN_TYPE(OCLClkEvent, OCLClkEventTy)
0253 
0254 // OpenCL queue_t.
0255 BUILTIN_TYPE(OCLQueue, OCLQueueTy)
0256 
0257 // OpenCL reserve_id_t.
0258 BUILTIN_TYPE(OCLReserveID, OCLReserveIDTy)
0259 
0260 // This represents the type of an expression whose type is
0261 // totally unknown, e.g. 'T::foo'.  It is permitted for this to
0262 // appear in situations where the structure of the type is
0263 // theoretically deducible.
0264 BUILTIN_TYPE(Dependent, DependentTy)
0265 
0266 // The type of an unresolved overload set.  A placeholder type.
0267 // Expressions with this type have one of the following basic
0268 // forms, with parentheses generally permitted:
0269 //   foo          # possibly qualified, not if an implicit access
0270 //   foo          # possibly qualified, not if an implicit access
0271 //   &foo         # possibly qualified, not if an implicit access
0272 //   x->foo       # only if might be a static member function
0273 //   &x->foo      # only if might be a static member function
0274 //   &Class::foo  # when a pointer-to-member; sub-expr also has this type
0275 // OverloadExpr::find can be used to analyze the expression.
0276 //
0277 // Overload should be the first placeholder type, or else change
0278 // BuiltinType::isNonOverloadPlaceholderType()
0279 PLACEHOLDER_TYPE(Overload, OverloadTy)
0280 
0281 // The type of a bound C++ non-static member function.
0282 // A placeholder type.  Expressions with this type have one of the
0283 // following basic forms:
0284 //   foo          # if an implicit access
0285 //   x->foo       # if only contains non-static members
0286 PLACEHOLDER_TYPE(BoundMember, BoundMemberTy)
0287 
0288 // The type of an unresolved template. Used in UnresolvedLookupExpr.
0289 PLACEHOLDER_TYPE(UnresolvedTemplate, UnresolvedTemplateTy)
0290 
0291 // The type of an expression which refers to a pseudo-object,
0292 // such as those introduced by Objective C's @property or
0293 // VS.NET's __property declarations.  A placeholder type.  The
0294 // pseudo-object is actually accessed by emitting a call to
0295 // some sort of function or method;  typically there is a pair
0296 // of a setter and a getter, with the setter used if the
0297 // pseudo-object reference is used syntactically as the
0298 // left-hand-side of an assignment operator.
0299 //
0300 // A pseudo-object reference naming an Objective-C @property is
0301 // always a dot access with a base of object-pointer type,
0302 // e.g. 'x.foo'.
0303 //
0304 // In VS.NET, a __property declaration creates an implicit
0305 // member with an associated name, which can then be named
0306 // in any of the normal ways an ordinary member could be.
0307 PLACEHOLDER_TYPE(PseudoObject, PseudoObjectTy)
0308 
0309 // __builtin_any_type.  A placeholder type.  Useful for clients
0310 // like debuggers that don't know what type to give something.
0311 // Only a small number of operations are valid on expressions of
0312 // unknown type, most notably explicit casts.
0313 PLACEHOLDER_TYPE(UnknownAny, UnknownAnyTy)
0314 
0315 PLACEHOLDER_TYPE(BuiltinFn, BuiltinFnTy)
0316 
0317 // The type of a cast which, in ARC, would normally require a
0318 // __bridge, but which might be okay depending on the immediate
0319 // context.
0320 PLACEHOLDER_TYPE(ARCUnbridgedCast, ARCUnbridgedCastTy)
0321 
0322 // A placeholder type for incomplete matrix index expressions.
0323 PLACEHOLDER_TYPE(IncompleteMatrixIdx, IncompleteMatrixIdxTy)
0324 
0325 // A placeholder type for OpenMP array sections.
0326 PLACEHOLDER_TYPE(ArraySection, ArraySectionTy)
0327 
0328 // A placeholder type for OpenMP array shaping operation.
0329 PLACEHOLDER_TYPE(OMPArrayShaping, OMPArrayShapingTy)
0330 
0331 // A placeholder type for OpenMP iterators.
0332 PLACEHOLDER_TYPE(OMPIterator, OMPIteratorTy)
0333 
0334 #ifdef LAST_BUILTIN_TYPE
0335 LAST_BUILTIN_TYPE(OMPIterator)
0336 #undef LAST_BUILTIN_TYPE
0337 #endif
0338 
0339 #undef SHARED_SINGLETON_TYPE
0340 #undef PLACEHOLDER_TYPE
0341 #undef FLOATING_TYPE
0342 #undef SIGNED_TYPE
0343 #undef UNSIGNED_TYPE
0344 #undef BUILTIN_TYPE