1 //===-- BuiltinTypes.def - Metadata about BuiltinTypes ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the database about various builtin singleton types.
12 // BuiltinType::Id is the enumerator defining the type.
14 // Context.SingletonId is the global singleton of this type. Some global
15 // singletons are shared by multiple types.
17 // BUILTIN_TYPE(Id, SingletonId) - A builtin type that has not been
18 // covered by any other #define. Defining this macro covers all
21 // SIGNED_TYPE(Id, SingletonId) - A signed integral type.
23 // UNSIGNED_TYPE(Id, SingletonId) - An unsigned integral type.
25 // FLOATING_TYPE(Id, SingletonId) - A floating-point type.
27 // PLACEHOLDER_TYPE(Id, SingletonId) - A placeholder type. Placeholder
28 // types are used to perform context-sensitive checking of specific
29 // forms of expression.
31 // SHARED_SINGLETON_TYPE(Expansion) - The given expansion corresponds
32 // to a builtin which uses a shared singleton type.
34 //===----------------------------------------------------------------------===//
37 #define SIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
41 #define UNSIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
45 #define FLOATING_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
48 #ifndef PLACEHOLDER_TYPE
49 #define PLACEHOLDER_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
52 #ifndef SHARED_SINGLETON_TYPE
53 #define SHARED_SINGLETON_TYPE(Expansion) Expansion
56 //===- Builtin Types ------------------------------------------------------===//
59 BUILTIN_TYPE(Void, VoidTy)
61 //===- Unsigned Types -----------------------------------------------------===//
63 // 'bool' in C++, '_Bool' in C99
64 UNSIGNED_TYPE(Bool, BoolTy)
66 // 'char' for targets where it's unsigned
67 SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(Char_U, CharTy))
69 // 'unsigned char', explicitly qualified
70 UNSIGNED_TYPE(UChar, UnsignedCharTy)
72 // 'wchar_t' for targets where it's unsigned
73 SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(WChar_U, WCharTy))
76 UNSIGNED_TYPE(Char16, Char16Ty)
79 UNSIGNED_TYPE(Char32, Char32Ty)
82 UNSIGNED_TYPE(UShort, UnsignedShortTy)
85 UNSIGNED_TYPE(UInt, UnsignedIntTy)
88 UNSIGNED_TYPE(ULong, UnsignedLongTy)
90 // 'unsigned long long'
91 UNSIGNED_TYPE(ULongLong, UnsignedLongLongTy)
94 UNSIGNED_TYPE(UInt128, UnsignedInt128Ty)
96 //===- Signed Types -------------------------------------------------------===//
98 // 'char' for targets where it's signed
99 SHARED_SINGLETON_TYPE(SIGNED_TYPE(Char_S, CharTy))
101 // 'signed char', explicitly qualified
102 SIGNED_TYPE(SChar, SignedCharTy)
104 // 'wchar_t' for targets where it's signed
105 SHARED_SINGLETON_TYPE(SIGNED_TYPE(WChar_S, WCharTy))
107 // 'short' or 'signed short'
108 SIGNED_TYPE(Short, ShortTy)
110 // 'int' or 'signed int'
111 SIGNED_TYPE(Int, IntTy)
113 // 'long' or 'signed long'
114 SIGNED_TYPE(Long, LongTy)
116 // 'long long' or 'signed long long'
117 SIGNED_TYPE(LongLong, LongLongTy)
120 SIGNED_TYPE(Int128, Int128Ty)
122 //===- Floating point types -----------------------------------------------===//
124 // 'half' in OpenCL, '__fp16' in ARM NEON.
125 FLOATING_TYPE(Half, HalfTy)
128 FLOATING_TYPE(Float, FloatTy)
131 FLOATING_TYPE(Double, DoubleTy)
134 FLOATING_TYPE(LongDouble, LongDoubleTy)
136 //===- Language-specific types --------------------------------------------===//
138 // This is the type of C++0x 'nullptr'.
139 BUILTIN_TYPE(NullPtr, NullPtrTy)
141 // The primitive Objective C 'id' type. The user-visible 'id'
142 // type is a typedef of an ObjCObjectPointerType to an
143 // ObjCObjectType with this as its base. In fact, this only ever
144 // shows up in an AST as the base type of an ObjCObjectType.
145 BUILTIN_TYPE(ObjCId, ObjCBuiltinIdTy)
147 // The primitive Objective C 'Class' type. The user-visible
148 // 'Class' type is a typedef of an ObjCObjectPointerType to an
149 // ObjCObjectType with this as its base. In fact, this only ever
150 // shows up in an AST as the base type of an ObjCObjectType.
151 BUILTIN_TYPE(ObjCClass, ObjCBuiltinClassTy)
153 // The primitive Objective C 'SEL' type. The user-visible 'SEL'
154 // type is a typedef of a PointerType to this.
155 BUILTIN_TYPE(ObjCSel, ObjCBuiltinSelTy)
157 // OpenCL image types.
158 BUILTIN_TYPE(OCLImage1d, OCLImage1dTy)
159 BUILTIN_TYPE(OCLImage1dArray, OCLImage1dArrayTy)
160 BUILTIN_TYPE(OCLImage1dBuffer, OCLImage1dBufferTy)
161 BUILTIN_TYPE(OCLImage2d, OCLImage2dTy)
162 BUILTIN_TYPE(OCLImage2dArray, OCLImage2dArrayTy)
163 BUILTIN_TYPE(OCLImage2dDepth, OCLImage2dDepthTy)
164 BUILTIN_TYPE(OCLImage2dArrayDepth, OCLImage2dArrayDepthTy)
165 BUILTIN_TYPE(OCLImage2dMSAA, OCLImage2dMSAATy)
166 BUILTIN_TYPE(OCLImage2dArrayMSAA, OCLImage2dArrayMSAATy)
167 BUILTIN_TYPE(OCLImage2dMSAADepth, OCLImage2dMSAADepthTy)
168 BUILTIN_TYPE(OCLImage2dArrayMSAADepth, OCLImage2dArrayMSAADepthTy)
169 BUILTIN_TYPE(OCLImage3d, OCLImage3dTy)
172 BUILTIN_TYPE(OCLSampler, OCLSamplerTy)
175 BUILTIN_TYPE(OCLEvent, OCLEventTy)
177 // OpenCL clk_event_t.
178 BUILTIN_TYPE(OCLClkEvent, OCLClkEventTy)
181 BUILTIN_TYPE(OCLQueue, OCLQueueTy)
184 BUILTIN_TYPE(OCLNDRange, OCLNDRangeTy)
186 // OpenCL reserve_id_t.
187 BUILTIN_TYPE(OCLReserveID, OCLReserveIDTy)
189 // This represents the type of an expression whose type is
190 // totally unknown, e.g. 'T::foo'. It is permitted for this to
191 // appear in situations where the structure of the type is
192 // theoretically deducible.
193 BUILTIN_TYPE(Dependent, DependentTy)
195 // The type of an unresolved overload set. A placeholder type.
196 // Expressions with this type have one of the following basic
197 // forms, with parentheses generally permitted:
198 // foo # possibly qualified, not if an implicit access
199 // foo # possibly qualified, not if an implicit access
200 // &foo # possibly qualified, not if an implicit access
201 // x->foo # only if might be a static member function
202 // &x->foo # only if might be a static member function
203 // &Class::foo # when a pointer-to-member; sub-expr also has this type
204 // OverloadExpr::find can be used to analyze the expression.
206 // Overload should be the first placeholder type, or else change
207 // BuiltinType::isNonOverloadPlaceholderType()
208 PLACEHOLDER_TYPE(Overload, OverloadTy)
210 // The type of a bound C++ non-static member function.
211 // A placeholder type. Expressions with this type have one of the
212 // following basic forms:
213 // foo # if an implicit access
214 // x->foo # if only contains non-static members
215 PLACEHOLDER_TYPE(BoundMember, BoundMemberTy)
217 // The type of an expression which refers to a pseudo-object,
218 // such as those introduced by Objective C's @property or
219 // VS.NET's __property declarations. A placeholder type. The
220 // pseudo-object is actually accessed by emitting a call to
221 // some sort of function or method; typically there is a pair
222 // of a setter and a getter, with the setter used if the
223 // pseudo-object reference is used syntactically as the
224 // left-hand-side of an assignment operator.
226 // A pseudo-object reference naming an Objective-C @property is
227 // always a dot access with a base of object-pointer type,
230 // In VS.NET, a __property declaration creates an implicit
231 // member with an associated name, which can then be named
232 // in any of the normal ways an ordinary member could be.
233 PLACEHOLDER_TYPE(PseudoObject, PseudoObjectTy)
235 // __builtin_any_type. A placeholder type. Useful for clients
236 // like debuggers that don't know what type to give something.
237 // Only a small number of operations are valid on expressions of
238 // unknown type, most notably explicit casts.
239 PLACEHOLDER_TYPE(UnknownAny, UnknownAnyTy)
241 PLACEHOLDER_TYPE(BuiltinFn, BuiltinFnTy)
243 // The type of a cast which, in ARC, would normally require a
244 // __bridge, but which might be okay depending on the immediate
246 PLACEHOLDER_TYPE(ARCUnbridgedCast, ARCUnbridgedCastTy)
248 // A placeholder type for OpenMP array sections.
249 PLACEHOLDER_TYPE(OMPArraySection, OMPArraySectionTy)
251 #ifdef LAST_BUILTIN_TYPE
252 LAST_BUILTIN_TYPE(OMPArraySection)
253 #undef LAST_BUILTIN_TYPE
256 #undef SHARED_SINGLETON_TYPE
257 #undef PLACEHOLDER_TYPE