aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/include/clang/AST/BuiltinTypes.def
blob: 34e6fc5cd826daf3273e1e1b59c6da88569abecf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
//===-- BuiltinTypeNodes.def - Metadata about BuiltinTypes ------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the database about various builtin singleton types.
//
//  BuiltinType::Id is the enumerator defining the type.
//
//  Context.SingletonId is the global singleton of this type.  Some global
//  singletons are shared by multiple types.
//
//    BUILTIN_TYPE(Id, SingletonId) - A builtin type that has not been
//    covered by any other #define.  Defining this macro covers all
//    the builtins.
//
//    SIGNED_TYPE(Id, SingletonId) - A signed integral type.
//
//    UNSIGNED_TYPE(Id, SingletonId) - An unsigned integral type.
//
//    FLOATING_TYPE(Id, SingletonId) - A floating-point type.
//
//    PLACEHOLDER_TYPE(Id, SingletonId) - A placeholder type.  Placeholder
//    types are used to perform context-sensitive checking of specific
//    forms of expression.
//
//    SHARED_SINGLETON_TYPE(Expansion) - The given expansion corresponds
//    to a builtin which uses a shared singleton type.
//
//===----------------------------------------------------------------------===//

#ifndef SIGNED_TYPE
#define SIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
#endif

#ifndef UNSIGNED_TYPE
#define UNSIGNED_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
#endif

#ifndef FLOATING_TYPE
#define FLOATING_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
#endif

#ifndef PLACEHOLDER_TYPE
#define PLACEHOLDER_TYPE(Id, SingletonId) BUILTIN_TYPE(Id, SingletonId)
#endif

#ifndef SHARED_SINGLETON_TYPE
#define SHARED_SINGLETON_TYPE(Expansion) Expansion
#endif

//===- Builtin Types ------------------------------------------------------===//

// void
BUILTIN_TYPE(Void, VoidTy)

//===- Unsigned Types -----------------------------------------------------===//

// 'bool' in C++, '_Bool' in C99
UNSIGNED_TYPE(Bool, BoolTy)

// 'char' for targets where it's unsigned
SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(Char_U, CharTy))

// 'unsigned char', explicitly qualified
UNSIGNED_TYPE(UChar, UnsignedCharTy)

// 'wchar_t' for targets where it's unsigned
SHARED_SINGLETON_TYPE(UNSIGNED_TYPE(WChar_U, WCharTy))

// 'char16_t' in C++
UNSIGNED_TYPE(Char16, Char16Ty)

// 'char32_t' in C++
UNSIGNED_TYPE(Char32, Char32Ty)

// 'unsigned short'
UNSIGNED_TYPE(UShort, UnsignedShortTy)

// 'unsigned int'
UNSIGNED_TYPE(UInt, UnsignedIntTy)

// 'unsigned long'
UNSIGNED_TYPE(ULong, UnsignedLongTy)

// 'unsigned long long'
UNSIGNED_TYPE(ULongLong, UnsignedLongLongTy)

// '__uint128_t'
UNSIGNED_TYPE(UInt128, UnsignedInt128Ty)

//===- Signed Types -------------------------------------------------------===//

// 'char' for targets where it's signed
SHARED_SINGLETON_TYPE(SIGNED_TYPE(Char_S, CharTy))

// 'signed char', explicitly qualified
SIGNED_TYPE(SChar, SignedCharTy)

// 'wchar_t' for targets where it's signed
SHARED_SINGLETON_TYPE(SIGNED_TYPE(WChar_S, WCharTy))

// 'short' or 'signed short'
SIGNED_TYPE(Short, ShortTy)

// 'int' or 'signed int'
SIGNED_TYPE(Int, IntTy)

// 'long' or 'signed long'
SIGNED_TYPE(Long, LongTy)

// 'long long' or 'signed long long'
SIGNED_TYPE(LongLong, LongLongTy)

// '__int128_t'
SIGNED_TYPE(Int128, Int128Ty)

//===- Floating point types -----------------------------------------------===//

// 'half' in OpenCL, '__fp16' in ARM NEON.
FLOATING_TYPE(Half, HalfTy)

// 'float'
FLOATING_TYPE(Float, FloatTy)

// 'double'
FLOATING_TYPE(Double, DoubleTy)

// 'long double'
FLOATING_TYPE(LongDouble, LongDoubleTy)

//===- Language-specific types --------------------------------------------===//

// This is the type of C++0x 'nullptr'.
BUILTIN_TYPE(NullPtr, NullPtrTy)

// The primitive Objective C 'id' type.  The user-visible 'id'
// type is a typedef of an ObjCObjectPointerType to an
// ObjCObjectType with this as its base.  In fact, this only ever
// shows up in an AST as the base type of an ObjCObjectType.
BUILTIN_TYPE(ObjCId, ObjCBuiltinIdTy)

// The primitive Objective C 'Class' type.  The user-visible
// 'Class' type is a typedef of an ObjCObjectPointerType to an
// ObjCObjectType with this as its base.  In fact, this only ever
// shows up in an AST as the base type of an ObjCObjectType.
BUILTIN_TYPE(ObjCClass, ObjCBuiltinClassTy)

// The primitive Objective C 'SEL' type.  The user-visible 'SEL'
// type is a typedef of a PointerType to this.
BUILTIN_TYPE(ObjCSel, ObjCBuiltinSelTy)

// This represents the type of an expression whose type is
// totally unknown, e.g. 'T::foo'.  It is permitted for this to
// appear in situations where the structure of the type is
// theoretically deducible.
BUILTIN_TYPE(Dependent, DependentTy)

// The type of an unresolved overload set.  A placeholder type.
// Expressions with this type have one of the following basic
// forms, with parentheses generally permitted:
//   foo          # possibly qualified, not if an implicit access
//   foo          # possibly qualified, not if an implicit access
//   &foo         # possibly qualified, not if an implicit access
//   x->foo       # only if might be a static member function
//   &x->foo      # only if might be a static member function
//   &Class::foo  # when a pointer-to-member; sub-expr also has this type
// OverloadExpr::find can be used to analyze the expression.
//
// Overload should be the first placeholder type, or else change
// BuiltinType::isNonOverloadPlaceholderType()
PLACEHOLDER_TYPE(Overload, OverloadTy)

// The type of a bound C++ non-static member function.
// A placeholder type.  Expressions with this type have one of the
// following basic forms:
//   foo          # if an implicit access
//   x->foo       # if only contains non-static members
PLACEHOLDER_TYPE(BoundMember, BoundMemberTy)

// The type of an expression which refers to a pseudo-object,
// such as those introduced by Objective C's @property or
// VS.NET's __property declarations.  A placeholder type.  The
// pseudo-object is actually accessed by emitting a call to
// some sort of function or method;  typically there is a pair
// of a setter and a getter, with the setter used if the
// pseudo-object reference is used syntactically as the
// left-hand-side of an assignment operator.
//
// A pseudo-object reference naming an Objective-C @property is
// always a dot access with a base of object-pointer type,
// e.g. 'x.foo'.
//
// In VS.NET, a __property declaration creates an implicit
// member with an associated name, which can then be named
// in any of the normal ways an ordinary member could be.
PLACEHOLDER_TYPE(PseudoObject, PseudoObjectTy)

// __builtin_any_type.  A placeholder type.  Useful for clients
// like debuggers that don't know what type to give something.
// Only a small number of operations are valid on expressions of
// unknown type, most notably explicit casts.
PLACEHOLDER_TYPE(UnknownAny, UnknownAnyTy)

// The type of a cast which, in ARC, would normally require a
// __bridge, but which might be okay depending on the immediate
// context.
PLACEHOLDER_TYPE(ARCUnbridgedCast, ARCUnbridgedCastTy)

#ifdef LAST_BUILTIN_TYPE
LAST_BUILTIN_TYPE(ARCUnbridgedCast)
#undef LAST_BUILTIN_TYPE
#endif

#undef SHARED_SINGLETON_TYPE
#undef PLACEHOLDER_TYPE
#undef FLOATING_TYPE
#undef SIGNED_TYPE
#undef UNSIGNED_TYPE
#undef BUILTIN_TYPE