Warning: That file was not part of the compilation database. It may have many parsing errors.

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

Warning: That file was not part of the compilation database. It may have many parsing errors.