]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/AST/BuiltinTypes.def
zfs: merge openzfs/zfs@52bad4f23 (zfs-2.1-release) into stable/13
[FreeBSD/FreeBSD.git] / contrib / llvm-project / clang / include / clang / AST / BuiltinTypes.def
1 //===-- BuiltinTypes.def - Metadata about BuiltinTypes ----------*- 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 //  This file defines the database about various builtin singleton types.
10 //
11 //  BuiltinType::Id is the enumerator defining the type.
12 //
13 //  Context.SingletonId is the global singleton of this type.  Some global
14 //  singletons are shared by multiple types.
15 //
16 //    BUILTIN_TYPE(Id, SingletonId) - A builtin type that has not been
17 //    covered by any other #define.  Defining this macro covers all
18 //    the builtins.
19 //
20 //    SIGNED_TYPE(Id, SingletonId) - A signed integral type.
21 //
22 //    UNSIGNED_TYPE(Id, SingletonId) - An unsigned integral type.
23 //
24 //    FLOATING_TYPE(Id, SingletonId) - A floating-point type.
25 //
26 //    PLACEHOLDER_TYPE(Id, SingletonId) - A placeholder type.  Placeholder
27 //    types are used to perform context-sensitive checking of specific
28 //    forms of expression.
29 //
30 //    SHARED_SINGLETON_TYPE(Expansion) - The given expansion corresponds
31 //    to a builtin which uses a shared singleton type.
32 //
33 //===----------------------------------------------------------------------===//
34
35 #ifndef SIGNED_TYPE
36 #define SIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
37 #endif
38
39 #ifndef UNSIGNED_TYPE
40 #define UNSIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
41 #endif
42
43 #ifndef FLOATING_TYPE
44 #define FLOATING_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
45 #endif
46
47 #ifndef PLACEHOLDER_TYPE
48 #define PLACEHOLDER_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
49 #endif
50
51 #ifndef SHARED_SINGLETON_TYPE
52 #define SHARED_SINGLETON_TYPE(Expansion) Expansion
53 #endif
54
55 //===- Builtin Types ------------------------------------------------------===//
56
57 // void
58 BUILTIN_TYPE(Void, VoidTy)
59
60 //===- Unsigned Types -----------------------------------------------------===//
61
62 // 'bool' in C++, '_Bool' in C99
63 UNSIGNED_TYPE(Bool, BoolTy)
64
65 // 'char' for targets where it's unsigned
66 SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(Char_U, CharTy))
67
68 // 'unsigned char', explicitly qualified
69 UNSIGNED_TYPE(UChar, UnsignedCharTy)
70
71 // 'wchar_t' for targets where it's unsigned
72 SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(WChar_U, WCharTy))
73
74 // 'char8_t' in C++20 (proposed)
75 UNSIGNED_TYPE(Char8, Char8Ty)
76
77 // 'char16_t' in C++
78 UNSIGNED_TYPE(Char16, Char16Ty)
79
80 // 'char32_t' in C++
81 UNSIGNED_TYPE(Char32, Char32Ty)
82
83 // 'unsigned short'
84 UNSIGNED_TYPE(UShort, UnsignedShortTy)
85
86 // 'unsigned int'
87 UNSIGNED_TYPE(UInt, UnsignedIntTy)
88
89 // 'unsigned long'
90 UNSIGNED_TYPE(ULong, UnsignedLongTy)
91
92 // 'unsigned long long'
93 UNSIGNED_TYPE(ULongLong, UnsignedLongLongTy)
94
95 // '__uint128_t'
96 UNSIGNED_TYPE(UInt128, UnsignedInt128Ty)
97
98 //===- Signed Types -------------------------------------------------------===//
99
100 // 'char' for targets where it's signed
101 SHARED_SINGLETON_TYPE(SIGNED_TYPE(Char_S, CharTy))
102
103 // 'signed char', explicitly qualified
104 SIGNED_TYPE(SChar, SignedCharTy)
105
106 // 'wchar_t' for targets where it's signed
107 SHARED_SINGLETON_TYPE(SIGNED_TYPE(WChar_S, WCharTy))
108
109 // 'short' or 'signed short'
110 SIGNED_TYPE(Short, ShortTy)
111
112 // 'int' or 'signed int'
113 SIGNED_TYPE(Int, IntTy)
114
115 // 'long' or 'signed long'
116 SIGNED_TYPE(Long, LongTy)
117
118 // 'long long' or 'signed long long'
119 SIGNED_TYPE(LongLong, LongLongTy)
120
121 // '__int128_t'
122 SIGNED_TYPE(Int128, Int128Ty)
123
124 //===- Fixed point types --------------------------------------------------===//
125
126 // 'short _Accum'
127 SIGNED_TYPE(ShortAccum, ShortAccumTy)
128
129 // '_Accum'
130 SIGNED_TYPE(Accum, AccumTy)
131
132 // 'long _Accum'
133 SIGNED_TYPE(LongAccum, LongAccumTy)
134
135 // 'unsigned short _Accum'
136 UNSIGNED_TYPE(UShortAccum, UnsignedShortAccumTy)
137
138 // 'unsigned _Accum'
139 UNSIGNED_TYPE(UAccum, UnsignedAccumTy)
140
141 // 'unsigned long _Accum'
142 UNSIGNED_TYPE(ULongAccum, UnsignedLongAccumTy)
143
144 // 'short _Fract'
145 SIGNED_TYPE(ShortFract, ShortFractTy)
146
147 // '_Fract'
148 SIGNED_TYPE(Fract, FractTy)
149
150 // 'long _Fract'
151 SIGNED_TYPE(LongFract, LongFractTy)
152
153 // 'unsigned short _Fract'
154 UNSIGNED_TYPE(UShortFract, UnsignedShortFractTy)
155
156 // 'unsigned _Fract'
157 UNSIGNED_TYPE(UFract, UnsignedFractTy)
158
159 // 'unsigned long _Fract'
160 UNSIGNED_TYPE(ULongFract, UnsignedLongFractTy)
161
162 // '_Sat short _Accum'
163 SIGNED_TYPE(SatShortAccum, SatShortAccumTy)
164
165 // '_Sat _Accum'
166 SIGNED_TYPE(SatAccum, SatAccumTy)
167
168 // '_Sat long _Accum'
169 SIGNED_TYPE(SatLongAccum, SatLongAccumTy)
170
171 // '_Sat unsigned short _Accum'
172 UNSIGNED_TYPE(SatUShortAccum, SatUnsignedShortAccumTy)
173
174 // '_Sat unsigned _Accum'
175 UNSIGNED_TYPE(SatUAccum, SatUnsignedAccumTy)
176
177 // '_Sat unsigned long _Accum'
178 UNSIGNED_TYPE(SatULongAccum, SatUnsignedLongAccumTy)
179
180 // '_Sat short _Fract'
181 SIGNED_TYPE(SatShortFract, SatShortFractTy)
182
183 // '_Sat _Fract'
184 SIGNED_TYPE(SatFract, SatFractTy)
185
186 // '_Sat long _Fract'
187 SIGNED_TYPE(SatLongFract, SatLongFractTy)
188
189 // '_Sat unsigned short _Fract'
190 UNSIGNED_TYPE(SatUShortFract, SatUnsignedShortFractTy)
191
192 // '_Sat unsigned _Fract'
193 UNSIGNED_TYPE(SatUFract, SatUnsignedFractTy)
194
195 // '_Sat unsigned long _Fract'
196 UNSIGNED_TYPE(SatULongFract, SatUnsignedLongFractTy)
197
198 //===- Floating point types -----------------------------------------------===//
199
200 // 'half' in OpenCL, '__fp16' in ARM NEON.
201 FLOATING_TYPE(Half, HalfTy)
202
203 // 'float'
204 FLOATING_TYPE(Float, FloatTy)
205
206 // 'double'
207 FLOATING_TYPE(Double, DoubleTy)
208
209 // 'long double'
210 FLOATING_TYPE(LongDouble, LongDoubleTy)
211
212 // '_Float16'
213 FLOATING_TYPE(Float16, HalfTy)
214
215 // '__bf16'
216 FLOATING_TYPE(BFloat16, BFloat16Ty)
217
218 // '__float128'
219 FLOATING_TYPE(Float128, Float128Ty)
220
221 //===- Language-specific types --------------------------------------------===//
222
223 // This is the type of C++0x 'nullptr'.
224 BUILTIN_TYPE(NullPtr, NullPtrTy)
225
226 // The primitive Objective C 'id' type.  The user-visible 'id'
227 // type is a typedef of an ObjCObjectPointerType to an
228 // ObjCObjectType with this as its base.  In fact, this only ever
229 // shows up in an AST as the base type of an ObjCObjectType.
230 BUILTIN_TYPE(ObjCId, ObjCBuiltinIdTy)
231
232 // The primitive Objective C 'Class' type.  The user-visible
233 // 'Class' type is a typedef of an ObjCObjectPointerType to an
234 // ObjCObjectType with this as its base.  In fact, this only ever
235 // shows up in an AST as the base type of an ObjCObjectType.
236 BUILTIN_TYPE(ObjCClass, ObjCBuiltinClassTy)
237
238 // The primitive Objective C 'SEL' type.  The user-visible 'SEL'
239 // type is a typedef of a PointerType to this.
240 BUILTIN_TYPE(ObjCSel, ObjCBuiltinSelTy)
241
242 // OpenCL sampler_t.
243 BUILTIN_TYPE(OCLSampler, OCLSamplerTy)
244
245 // OpenCL event_t.
246 BUILTIN_TYPE(OCLEvent, OCLEventTy)
247
248 // OpenCL clk_event_t.
249 BUILTIN_TYPE(OCLClkEvent, OCLClkEventTy)
250
251 // OpenCL queue_t.
252 BUILTIN_TYPE(OCLQueue, OCLQueueTy)
253
254 // OpenCL reserve_id_t.
255 BUILTIN_TYPE(OCLReserveID, OCLReserveIDTy)
256
257 // This represents the type of an expression whose type is
258 // totally unknown, e.g. 'T::foo'.  It is permitted for this to
259 // appear in situations where the structure of the type is
260 // theoretically deducible.
261 BUILTIN_TYPE(Dependent, DependentTy)
262
263 // The type of an unresolved overload set.  A placeholder type.
264 // Expressions with this type have one of the following basic
265 // forms, with parentheses generally permitted:
266 //   foo          # possibly qualified, not if an implicit access
267 //   foo          # possibly qualified, not if an implicit access
268 //   &foo         # possibly qualified, not if an implicit access
269 //   x->foo       # only if might be a static member function
270 //   &x->foo      # only if might be a static member function
271 //   &Class::foo  # when a pointer-to-member; sub-expr also has this type
272 // OverloadExpr::find can be used to analyze the expression.
273 //
274 // Overload should be the first placeholder type, or else change
275 // BuiltinType::isNonOverloadPlaceholderType()
276 PLACEHOLDER_TYPE(Overload, OverloadTy)
277
278 // The type of a bound C++ non-static member function.
279 // A placeholder type.  Expressions with this type have one of the
280 // following basic forms:
281 //   foo          # if an implicit access
282 //   x->foo       # if only contains non-static members
283 PLACEHOLDER_TYPE(BoundMember, BoundMemberTy)
284
285 // The type of an expression which refers to a pseudo-object,
286 // such as those introduced by Objective C's @property or
287 // VS.NET's __property declarations.  A placeholder type.  The
288 // pseudo-object is actually accessed by emitting a call to
289 // some sort of function or method;  typically there is a pair
290 // of a setter and a getter, with the setter used if the
291 // pseudo-object reference is used syntactically as the
292 // left-hand-side of an assignment operator.
293 //
294 // A pseudo-object reference naming an Objective-C @property is
295 // always a dot access with a base of object-pointer type,
296 // e.g. 'x.foo'.
297 //
298 // In VS.NET, a __property declaration creates an implicit
299 // member with an associated name, which can then be named
300 // in any of the normal ways an ordinary member could be.
301 PLACEHOLDER_TYPE(PseudoObject, PseudoObjectTy)
302
303 // __builtin_any_type.  A placeholder type.  Useful for clients
304 // like debuggers that don't know what type to give something.
305 // Only a small number of operations are valid on expressions of
306 // unknown type, most notably explicit casts.
307 PLACEHOLDER_TYPE(UnknownAny, UnknownAnyTy)
308
309 PLACEHOLDER_TYPE(BuiltinFn, BuiltinFnTy)
310
311 // The type of a cast which, in ARC, would normally require a
312 // __bridge, but which might be okay depending on the immediate
313 // context.
314 PLACEHOLDER_TYPE(ARCUnbridgedCast, ARCUnbridgedCastTy)
315
316 // A placeholder type for incomplete matrix index expressions.
317 PLACEHOLDER_TYPE(IncompleteMatrixIdx, IncompleteMatrixIdxTy)
318
319 // A placeholder type for OpenMP array sections.
320 PLACEHOLDER_TYPE(OMPArraySection, OMPArraySectionTy)
321
322 // A placeholder type for OpenMP array shaping operation.
323 PLACEHOLDER_TYPE(OMPArrayShaping, OMPArrayShapingTy)
324
325 // A placeholder type for OpenMP iterators.
326 PLACEHOLDER_TYPE(OMPIterator, OMPIteratorTy)
327
328 #ifdef LAST_BUILTIN_TYPE
329 LAST_BUILTIN_TYPE(OMPIterator)
330 #undef LAST_BUILTIN_TYPE
331 #endif
332
333 #undef SHARED_SINGLETON_TYPE
334 #undef PLACEHOLDER_TYPE
335 #undef FLOATING_TYPE
336 #undef SIGNED_TYPE
337 #undef UNSIGNED_TYPE
338 #undef BUILTIN_TYPE