]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/Builtins.def
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Basic / Builtins.def
1 //===--- Builtins.def - Builtin function info database ----------*- 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 standard builtin function database.  Users of this file
11 // must define the BUILTIN macro to make use of this information.
12 //
13 //===----------------------------------------------------------------------===//
14
15 // FIXME: This should really be a .td file, but that requires modifying tblgen.
16 // Perhaps tblgen should have plugins.
17
18 // The first value provided to the macro specifies the function name of the
19 // builtin, and results in a clang::builtin::BIXX enum value for XX.
20
21 // The second value provided to the macro specifies the type of the function
22 // (result value, then each argument) as follows:
23 //  v -> void
24 //  b -> boolean
25 //  c -> char
26 //  s -> short
27 //  i -> int
28 //  h -> half
29 //  f -> float
30 //  d -> double
31 //  z -> size_t
32 //  w -> wchar_t
33 //  F -> constant CFString
34 //  G -> id
35 //  H -> SEL
36 //  M -> struct objc_super
37 //  a -> __builtin_va_list
38 //  A -> "reference" to __builtin_va_list
39 //  V -> Vector, followed by the number of elements and the base type.
40 //  E -> ext_vector, followed by the number of elements and the base type.
41 //  X -> _Complex, followed by the base type.
42 //  Y -> ptrdiff_t
43 //  P -> FILE
44 //  J -> jmp_buf
45 //  SJ -> sigjmp_buf
46 //  K -> ucontext_t
47 //  p -> pid_t
48 //  . -> "...".  This may only occur at the end of the function list.
49 //
50 // Types may be prefixed with the following modifiers:
51 //  L   -> long (e.g. Li for 'long int', Ld for 'long double')
52 //  LL  -> long long (e.g. LLi for 'long long int', LLd for __float128)
53 //  LLL -> __int128_t (e.g. LLLi)
54 //  W   -> int64_t
55 //  N   -> 'int' size if target is LP64, 'L' otherwise.
56 //  S   -> signed
57 //  U   -> unsigned
58 //  I   -> Required to constant fold to an integer constant expression.
59 //
60 // Types may be postfixed with the following modifiers:
61 // * -> pointer (optionally followed by an address space number, if no address
62 //               space is specified than any address space will be accepted)
63 // & -> reference (optionally followed by an address space number)
64 // C -> const
65 // D -> volatile
66
67 // The third value provided to the macro specifies information about attributes
68 // of the function.  These must be kept in sync with the predicates in the
69 // Builtin::Context class.  Currently we have:
70 //  n -> nothrow
71 //  r -> noreturn
72 //  U -> pure
73 //  c -> const
74 //  t -> signature is meaningless, use custom typechecking
75 //  F -> this is a libc/libm function with a '__builtin_' prefix added.
76 //  f -> this is a libc/libm function without the '__builtin_' prefix. It can
77 //       be followed by ':headername:' to state which header this function
78 //       comes from.
79 //  h -> this function requires a specific header or an explicit declaration.
80 //  i -> this is a runtime library implemented function without the
81 //       '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
82 //  p:N: -> this is a printf-like function whose Nth argument is the format
83 //          string.
84 //  P:N: -> similar to the p:N: attribute, but the function is like vprintf
85 //          in that it accepts its arguments as a va_list rather than
86 //          through an ellipsis
87 //  s:N: -> this is a scanf-like function whose Nth argument is the format
88 //          string.
89 //  S:N: -> similar to the s:N: attribute, but the function is like vscanf
90 //          in that it accepts its arguments as a va_list rather than
91 //          through an ellipsis
92 //  e -> const, but only when -fno-math-errno
93 //  j -> returns_twice (like setjmp)
94 //  u -> arguments are not evaluated for their side-effects
95 //  V:N: -> requires vectors of at least N bits to be legal
96 //  FIXME: gcc has nonnull
97
98 #if defined(BUILTIN) && !defined(LIBBUILTIN)
99 #  define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
100 #endif
101
102 #if defined(BUILTIN) && !defined(LANGBUILTIN)
103 #  define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
104 #endif
105
106 // Standard libc/libm functions:
107 BUILTIN(__builtin_atan2 , "ddd"  , "Fne")
108 BUILTIN(__builtin_atan2f, "fff"  , "Fne")
109 BUILTIN(__builtin_atan2l, "LdLdLd", "Fne")
110 BUILTIN(__builtin_abs  , "ii"  , "ncF")
111 BUILTIN(__builtin_copysign, "ddd", "ncF")
112 BUILTIN(__builtin_copysignf, "fff", "ncF")
113 BUILTIN(__builtin_copysignl, "LdLdLd", "ncF")
114 BUILTIN(__builtin_copysignf128, "LLdLLdLLd", "ncF")
115 BUILTIN(__builtin_fabs , "dd"  , "ncF")
116 BUILTIN(__builtin_fabsf, "ff"  , "ncF")
117 BUILTIN(__builtin_fabsl, "LdLd", "ncF")
118 BUILTIN(__builtin_fabsf128, "LLdLLd", "ncF")
119 BUILTIN(__builtin_fmod , "ddd"  , "Fne")
120 BUILTIN(__builtin_fmodf, "fff"  , "Fne")
121 BUILTIN(__builtin_fmodl, "LdLdLd", "Fne")
122 BUILTIN(__builtin_frexp , "ddi*"  , "Fn")
123 BUILTIN(__builtin_frexpf, "ffi*"  , "Fn")
124 BUILTIN(__builtin_frexpl, "LdLdi*", "Fn")
125 BUILTIN(__builtin_huge_val, "d", "nc")
126 BUILTIN(__builtin_huge_valf, "f", "nc")
127 BUILTIN(__builtin_huge_vall, "Ld", "nc")
128 BUILTIN(__builtin_huge_valf128, "LLd", "nc")
129 BUILTIN(__builtin_inf  , "d"   , "nc")
130 BUILTIN(__builtin_inff , "f"   , "nc")
131 BUILTIN(__builtin_infl , "Ld"  , "nc")
132 BUILTIN(__builtin_inff128 , "LLd"  , "nc")
133 BUILTIN(__builtin_labs , "LiLi"  , "Fnc")
134 BUILTIN(__builtin_llabs, "LLiLLi", "Fnc")
135 BUILTIN(__builtin_ldexp , "ddi"  , "Fne")
136 BUILTIN(__builtin_ldexpf, "ffi"  , "Fne")
137 BUILTIN(__builtin_ldexpl, "LdLdi", "Fne")
138 BUILTIN(__builtin_modf , "ddd*"  , "Fn")
139 BUILTIN(__builtin_modff, "fff*"  , "Fn")
140 BUILTIN(__builtin_modfl, "LdLdLd*", "Fn")
141 BUILTIN(__builtin_nan,  "dcC*" , "FnU")
142 BUILTIN(__builtin_nanf, "fcC*" , "FnU")
143 BUILTIN(__builtin_nanl, "LdcC*", "FnU")
144 BUILTIN(__builtin_nanf128, "LLdcC*", "FnU")
145 BUILTIN(__builtin_nans,  "dcC*" , "FnU")
146 BUILTIN(__builtin_nansf, "fcC*" , "FnU")
147 BUILTIN(__builtin_nansl, "LdcC*", "FnU")
148 BUILTIN(__builtin_nansf128, "LLdcC*", "FnU")
149 BUILTIN(__builtin_powi , "ddi"  , "Fnc")
150 BUILTIN(__builtin_powif, "ffi"  , "Fnc")
151 BUILTIN(__builtin_powil, "LdLdi", "Fnc")
152 BUILTIN(__builtin_pow , "ddd"  , "Fne")
153 BUILTIN(__builtin_powf, "fff"  , "Fne")
154 BUILTIN(__builtin_powl, "LdLdLd", "Fne")
155
156 // Standard unary libc/libm functions with double/float/long double variants:
157 BUILTIN(__builtin_acos , "dd"  , "Fne")
158 BUILTIN(__builtin_acosf, "ff"  , "Fne")
159 BUILTIN(__builtin_acosl, "LdLd", "Fne")
160 BUILTIN(__builtin_acosh , "dd"  , "Fne")
161 BUILTIN(__builtin_acoshf, "ff"  , "Fne")
162 BUILTIN(__builtin_acoshl, "LdLd", "Fne")
163 BUILTIN(__builtin_asin , "dd"  , "Fne")
164 BUILTIN(__builtin_asinf, "ff"  , "Fne")
165 BUILTIN(__builtin_asinl, "LdLd", "Fne")
166 BUILTIN(__builtin_asinh , "dd"  , "Fne")
167 BUILTIN(__builtin_asinhf, "ff"  , "Fne")
168 BUILTIN(__builtin_asinhl, "LdLd", "Fne")
169 BUILTIN(__builtin_atan , "dd"  , "Fne")
170 BUILTIN(__builtin_atanf, "ff"  , "Fne")
171 BUILTIN(__builtin_atanl, "LdLd", "Fne")
172 BUILTIN(__builtin_atanh , "dd", "Fne")
173 BUILTIN(__builtin_atanhf, "ff", "Fne")
174 BUILTIN(__builtin_atanhl, "LdLd", "Fne")
175 BUILTIN(__builtin_cbrt , "dd", "Fnc")
176 BUILTIN(__builtin_cbrtf, "ff", "Fnc")
177 BUILTIN(__builtin_cbrtl, "LdLd", "Fnc")
178 BUILTIN(__builtin_ceil , "dd"  , "Fnc")
179 BUILTIN(__builtin_ceilf, "ff"  , "Fnc")
180 BUILTIN(__builtin_ceill, "LdLd", "Fnc")
181 BUILTIN(__builtin_cos , "dd"  , "Fne")
182 BUILTIN(__builtin_cosf, "ff"  , "Fne")
183 BUILTIN(__builtin_cosh , "dd"  , "Fne")
184 BUILTIN(__builtin_coshf, "ff"  , "Fne")
185 BUILTIN(__builtin_coshl, "LdLd", "Fne")
186 BUILTIN(__builtin_cosl, "LdLd", "Fne")
187 BUILTIN(__builtin_erf , "dd", "Fne")
188 BUILTIN(__builtin_erff, "ff", "Fne")
189 BUILTIN(__builtin_erfl, "LdLd", "Fne")
190 BUILTIN(__builtin_erfc , "dd", "Fne")
191 BUILTIN(__builtin_erfcf, "ff", "Fne")
192 BUILTIN(__builtin_erfcl, "LdLd", "Fne")
193 BUILTIN(__builtin_exp , "dd"  , "Fne")
194 BUILTIN(__builtin_expf, "ff"  , "Fne")
195 BUILTIN(__builtin_expl, "LdLd", "Fne")
196 BUILTIN(__builtin_exp2 , "dd"  , "Fne")
197 BUILTIN(__builtin_exp2f, "ff"  , "Fne")
198 BUILTIN(__builtin_exp2l, "LdLd", "Fne")
199 BUILTIN(__builtin_expm1 , "dd", "Fne")
200 BUILTIN(__builtin_expm1f, "ff", "Fne")
201 BUILTIN(__builtin_expm1l, "LdLd", "Fne")
202 BUILTIN(__builtin_fdim, "ddd", "Fne")
203 BUILTIN(__builtin_fdimf, "fff", "Fne")
204 BUILTIN(__builtin_fdiml, "LdLdLd", "Fne")
205 BUILTIN(__builtin_floor , "dd"  , "Fnc")
206 BUILTIN(__builtin_floorf, "ff"  , "Fnc")
207 BUILTIN(__builtin_floorl, "LdLd", "Fnc")
208 BUILTIN(__builtin_fma, "dddd", "Fne")
209 BUILTIN(__builtin_fmaf, "ffff", "Fne")
210 BUILTIN(__builtin_fmal, "LdLdLdLd", "Fne")
211 BUILTIN(__builtin_fmax, "ddd", "Fnc")
212 BUILTIN(__builtin_fmaxf, "fff", "Fnc")
213 BUILTIN(__builtin_fmaxl, "LdLdLd", "Fnc")
214 BUILTIN(__builtin_fmin, "ddd", "Fnc")
215 BUILTIN(__builtin_fminf, "fff", "Fnc")
216 BUILTIN(__builtin_fminl, "LdLdLd", "Fnc")
217 BUILTIN(__builtin_hypot , "ddd"  , "Fne")
218 BUILTIN(__builtin_hypotf, "fff"  , "Fne")
219 BUILTIN(__builtin_hypotl, "LdLdLd", "Fne")
220 BUILTIN(__builtin_ilogb , "id", "Fne")
221 BUILTIN(__builtin_ilogbf, "if", "Fne")
222 BUILTIN(__builtin_ilogbl, "iLd", "Fne")
223 BUILTIN(__builtin_lgamma , "dd", "Fn")
224 BUILTIN(__builtin_lgammaf, "ff", "Fn")
225 BUILTIN(__builtin_lgammal, "LdLd", "Fn")
226 BUILTIN(__builtin_llrint, "LLid", "Fne")
227 BUILTIN(__builtin_llrintf, "LLif", "Fne")
228 BUILTIN(__builtin_llrintl, "LLiLd", "Fne")
229 BUILTIN(__builtin_llround , "LLid", "Fne")
230 BUILTIN(__builtin_llroundf, "LLif", "Fne")
231 BUILTIN(__builtin_llroundl, "LLiLd", "Fne")
232 BUILTIN(__builtin_log , "dd"  , "Fne")
233 BUILTIN(__builtin_log10 , "dd"  , "Fne")
234 BUILTIN(__builtin_log10f, "ff"  , "Fne")
235 BUILTIN(__builtin_log10l, "LdLd", "Fne")
236 BUILTIN(__builtin_log1p , "dd"  , "Fne")
237 BUILTIN(__builtin_log1pf, "ff"  , "Fne")
238 BUILTIN(__builtin_log1pl, "LdLd", "Fne")
239 BUILTIN(__builtin_log2, "dd"  , "Fne")
240 BUILTIN(__builtin_log2f, "ff"  , "Fne")
241 BUILTIN(__builtin_log2l, "LdLd"  , "Fne")
242 BUILTIN(__builtin_logb , "dd", "Fne")
243 BUILTIN(__builtin_logbf, "ff", "Fne")
244 BUILTIN(__builtin_logbl, "LdLd", "Fne")
245 BUILTIN(__builtin_logf, "ff"  , "Fne")
246 BUILTIN(__builtin_logl, "LdLd", "Fne")
247 BUILTIN(__builtin_lrint , "Lid", "Fne")
248 BUILTIN(__builtin_lrintf, "Lif", "Fne")
249 BUILTIN(__builtin_lrintl, "LiLd", "Fne")
250 BUILTIN(__builtin_lround , "Lid", "Fne")
251 BUILTIN(__builtin_lroundf, "Lif", "Fne")
252 BUILTIN(__builtin_lroundl, "LiLd", "Fne")
253 BUILTIN(__builtin_nearbyint , "dd", "Fnc")
254 BUILTIN(__builtin_nearbyintf, "ff", "Fnc")
255 BUILTIN(__builtin_nearbyintl, "LdLd", "Fnc")
256 BUILTIN(__builtin_nextafter , "ddd", "Fne")
257 BUILTIN(__builtin_nextafterf, "fff", "Fne")
258 BUILTIN(__builtin_nextafterl, "LdLdLd", "Fne")
259 BUILTIN(__builtin_nexttoward , "ddLd", "Fne")
260 BUILTIN(__builtin_nexttowardf, "ffLd", "Fne")
261 BUILTIN(__builtin_nexttowardl, "LdLdLd", "Fne")
262 BUILTIN(__builtin_remainder , "ddd", "Fne")
263 BUILTIN(__builtin_remainderf, "fff", "Fne")
264 BUILTIN(__builtin_remainderl, "LdLdLd", "Fne")
265 BUILTIN(__builtin_remquo , "dddi*", "Fn")
266 BUILTIN(__builtin_remquof, "fffi*", "Fn")
267 BUILTIN(__builtin_remquol, "LdLdLdi*", "Fn")
268 BUILTIN(__builtin_rint , "dd", "Fnc")
269 BUILTIN(__builtin_rintf, "ff", "Fnc")
270 BUILTIN(__builtin_rintl, "LdLd", "Fnc")
271 BUILTIN(__builtin_round, "dd"  , "Fnc")
272 BUILTIN(__builtin_roundf, "ff"  , "Fnc")
273 BUILTIN(__builtin_roundl, "LdLd"  , "Fnc")
274 BUILTIN(__builtin_scalbln , "ddLi", "Fne")
275 BUILTIN(__builtin_scalblnf, "ffLi", "Fne")
276 BUILTIN(__builtin_scalblnl, "LdLdLi", "Fne")
277 BUILTIN(__builtin_scalbn , "ddi", "Fne")
278 BUILTIN(__builtin_scalbnf, "ffi", "Fne")
279 BUILTIN(__builtin_scalbnl, "LdLdi", "Fne")
280 BUILTIN(__builtin_sin , "dd"  , "Fne")
281 BUILTIN(__builtin_sinf, "ff"  , "Fne")
282 BUILTIN(__builtin_sinh , "dd"  , "Fne")
283 BUILTIN(__builtin_sinhf, "ff"  , "Fne")
284 BUILTIN(__builtin_sinhl, "LdLd", "Fne")
285 BUILTIN(__builtin_sinl, "LdLd", "Fne")
286 BUILTIN(__builtin_sqrt , "dd"  , "Fne")
287 BUILTIN(__builtin_sqrtf, "ff"  , "Fne")
288 BUILTIN(__builtin_sqrtl, "LdLd", "Fne")
289 BUILTIN(__builtin_tan , "dd"  , "Fne")
290 BUILTIN(__builtin_tanf, "ff"  , "Fne")
291 BUILTIN(__builtin_tanh , "dd"  , "Fne")
292 BUILTIN(__builtin_tanhf, "ff"  , "Fne")
293 BUILTIN(__builtin_tanhl, "LdLd", "Fne")
294 BUILTIN(__builtin_tanl, "LdLd", "Fne")
295 BUILTIN(__builtin_tgamma , "dd", "Fne")
296 BUILTIN(__builtin_tgammaf, "ff", "Fne")
297 BUILTIN(__builtin_tgammal, "LdLd", "Fne")
298 BUILTIN(__builtin_trunc , "dd", "Fnc")
299 BUILTIN(__builtin_truncf, "ff", "Fnc")
300 BUILTIN(__builtin_truncl, "LdLd", "Fnc")
301
302 // C99 complex builtins
303 BUILTIN(__builtin_cabs, "dXd", "Fne")
304 BUILTIN(__builtin_cabsf, "fXf", "Fne")
305 BUILTIN(__builtin_cabsl, "LdXLd", "Fne")
306 BUILTIN(__builtin_cacos, "XdXd", "Fne")
307 BUILTIN(__builtin_cacosf, "XfXf", "Fne")
308 BUILTIN(__builtin_cacosh, "XdXd", "Fne")
309 BUILTIN(__builtin_cacoshf, "XfXf", "Fne")
310 BUILTIN(__builtin_cacoshl, "XLdXLd", "Fne")
311 BUILTIN(__builtin_cacosl, "XLdXLd", "Fne")
312 BUILTIN(__builtin_carg, "dXd", "Fne")
313 BUILTIN(__builtin_cargf, "fXf", "Fne")
314 BUILTIN(__builtin_cargl, "LdXLd", "Fne")
315 BUILTIN(__builtin_casin, "XdXd", "Fne")
316 BUILTIN(__builtin_casinf, "XfXf", "Fne")
317 BUILTIN(__builtin_casinh, "XdXd", "Fne")
318 BUILTIN(__builtin_casinhf, "XfXf", "Fne")
319 BUILTIN(__builtin_casinhl, "XLdXLd", "Fne")
320 BUILTIN(__builtin_casinl, "XLdXLd", "Fne")
321 BUILTIN(__builtin_catan, "XdXd", "Fne")
322 BUILTIN(__builtin_catanf, "XfXf", "Fne")
323 BUILTIN(__builtin_catanh, "XdXd", "Fne")
324 BUILTIN(__builtin_catanhf, "XfXf", "Fne")
325 BUILTIN(__builtin_catanhl, "XLdXLd", "Fne")
326 BUILTIN(__builtin_catanl, "XLdXLd", "Fne")
327 BUILTIN(__builtin_ccos, "XdXd", "Fne")
328 BUILTIN(__builtin_ccosf, "XfXf", "Fne")
329 BUILTIN(__builtin_ccosl, "XLdXLd", "Fne")
330 BUILTIN(__builtin_ccosh, "XdXd", "Fne")
331 BUILTIN(__builtin_ccoshf, "XfXf", "Fne")
332 BUILTIN(__builtin_ccoshl, "XLdXLd", "Fne")
333 BUILTIN(__builtin_cexp, "XdXd", "Fne")
334 BUILTIN(__builtin_cexpf, "XfXf", "Fne")
335 BUILTIN(__builtin_cexpl, "XLdXLd", "Fne")
336 BUILTIN(__builtin_cimag, "dXd", "Fnc")
337 BUILTIN(__builtin_cimagf, "fXf", "Fnc")
338 BUILTIN(__builtin_cimagl, "LdXLd", "Fnc")
339 BUILTIN(__builtin_conj, "XdXd", "Fnc")
340 BUILTIN(__builtin_conjf, "XfXf", "Fnc")
341 BUILTIN(__builtin_conjl, "XLdXLd", "Fnc")
342 BUILTIN(__builtin_clog, "XdXd", "Fne")
343 BUILTIN(__builtin_clogf, "XfXf", "Fne")
344 BUILTIN(__builtin_clogl, "XLdXLd", "Fne")
345 BUILTIN(__builtin_cproj, "XdXd", "Fnc")
346 BUILTIN(__builtin_cprojf, "XfXf", "Fnc")
347 BUILTIN(__builtin_cprojl, "XLdXLd", "Fnc")
348 BUILTIN(__builtin_cpow, "XdXdXd", "Fne")
349 BUILTIN(__builtin_cpowf, "XfXfXf", "Fne")
350 BUILTIN(__builtin_cpowl, "XLdXLdXLd", "Fne")
351 BUILTIN(__builtin_creal, "dXd", "Fnc")
352 BUILTIN(__builtin_crealf, "fXf", "Fnc")
353 BUILTIN(__builtin_creall, "LdXLd", "Fnc")
354 BUILTIN(__builtin_csin, "XdXd", "Fne")
355 BUILTIN(__builtin_csinf, "XfXf", "Fne")
356 BUILTIN(__builtin_csinl, "XLdXLd", "Fne")
357 BUILTIN(__builtin_csinh, "XdXd", "Fne")
358 BUILTIN(__builtin_csinhf, "XfXf", "Fne")
359 BUILTIN(__builtin_csinhl, "XLdXLd", "Fne")
360 BUILTIN(__builtin_csqrt, "XdXd", "Fne")
361 BUILTIN(__builtin_csqrtf, "XfXf", "Fne")
362 BUILTIN(__builtin_csqrtl, "XLdXLd", "Fne")
363 BUILTIN(__builtin_ctan, "XdXd", "Fne")
364 BUILTIN(__builtin_ctanf, "XfXf", "Fne")
365 BUILTIN(__builtin_ctanl, "XLdXLd", "Fne")
366 BUILTIN(__builtin_ctanh, "XdXd", "Fne")
367 BUILTIN(__builtin_ctanhf, "XfXf", "Fne")
368 BUILTIN(__builtin_ctanhl, "XLdXLd", "Fne")
369
370 // FP Comparisons.
371 BUILTIN(__builtin_isgreater     , "i.", "Fnc")
372 BUILTIN(__builtin_isgreaterequal, "i.", "Fnc")
373 BUILTIN(__builtin_isless        , "i.", "Fnc")
374 BUILTIN(__builtin_islessequal   , "i.", "Fnc")
375 BUILTIN(__builtin_islessgreater , "i.", "Fnc")
376 BUILTIN(__builtin_isunordered   , "i.", "Fnc")
377
378 // Unary FP classification
379 BUILTIN(__builtin_fpclassify, "iiiiii.", "Fnc")
380 BUILTIN(__builtin_isfinite,   "i.", "Fnc")
381 BUILTIN(__builtin_isinf,      "i.", "Fnc")
382 BUILTIN(__builtin_isinf_sign, "i.", "Fnc")
383 BUILTIN(__builtin_isnan,      "i.", "Fnc")
384 BUILTIN(__builtin_isnormal,   "i.", "Fnc")
385
386 // FP signbit builtins
387 BUILTIN(__builtin_signbit, "i.", "Fnc")
388 BUILTIN(__builtin_signbitf, "if", "Fnc")
389 BUILTIN(__builtin_signbitl, "iLd", "Fnc")
390
391 // Special FP builtins.
392 BUILTIN(__builtin_canonicalize, "dd", "nc")
393 BUILTIN(__builtin_canonicalizef, "ff", "nc")
394 BUILTIN(__builtin_canonicalizel, "LdLd", "nc")
395
396 // Builtins for arithmetic.
397 BUILTIN(__builtin_clzs , "iUs"  , "nc")
398 BUILTIN(__builtin_clz  , "iUi"  , "nc")
399 BUILTIN(__builtin_clzl , "iULi" , "nc")
400 BUILTIN(__builtin_clzll, "iULLi", "nc")
401 // TODO: int clzimax(uintmax_t)
402 BUILTIN(__builtin_ctzs , "iUs"  , "nc")
403 BUILTIN(__builtin_ctz  , "iUi"  , "nc")
404 BUILTIN(__builtin_ctzl , "iULi" , "nc")
405 BUILTIN(__builtin_ctzll, "iULLi", "nc")
406 // TODO: int ctzimax(uintmax_t)
407 BUILTIN(__builtin_ffs  , "ii"  , "Fnc")
408 BUILTIN(__builtin_ffsl , "iLi" , "Fnc")
409 BUILTIN(__builtin_ffsll, "iLLi", "Fnc")
410 BUILTIN(__builtin_parity  , "iUi"  , "nc")
411 BUILTIN(__builtin_parityl , "iULi" , "nc")
412 BUILTIN(__builtin_parityll, "iULLi", "nc")
413 BUILTIN(__builtin_popcount  , "iUi"  , "nc")
414 BUILTIN(__builtin_popcountl , "iULi" , "nc")
415 BUILTIN(__builtin_popcountll, "iULLi", "nc")
416
417 // FIXME: These type signatures are not correct for targets with int != 32-bits
418 // or with ULL != 64-bits.
419 BUILTIN(__builtin_bswap16, "UsUs", "nc")
420 BUILTIN(__builtin_bswap32, "UiUi", "nc")
421 BUILTIN(__builtin_bswap64, "ULLiULLi", "nc")
422
423 BUILTIN(__builtin_bitreverse8, "UcUc", "nc")
424 BUILTIN(__builtin_bitreverse16, "UsUs", "nc")
425 BUILTIN(__builtin_bitreverse32, "UiUi", "nc")
426 BUILTIN(__builtin_bitreverse64, "ULLiULLi", "nc")
427
428 // Random GCC builtins
429 BUILTIN(__builtin_constant_p, "i.", "nctu")
430 BUILTIN(__builtin_classify_type, "i.", "nctu")
431 BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc")
432 BUILTIN(__builtin___NSStringMakeConstantString, "FC*cC*", "nc")
433 BUILTIN(__builtin_va_start, "vA.", "nt")
434 BUILTIN(__builtin_va_end, "vA", "n")
435 BUILTIN(__builtin_va_copy, "vAA", "n")
436 BUILTIN(__builtin_stdarg_start, "vA.", "n")
437 BUILTIN(__builtin_assume_aligned, "v*vC*z.", "nc")
438 BUILTIN(__builtin_bcmp, "iv*v*z", "Fn")
439 BUILTIN(__builtin_bcopy, "vv*v*z", "n")
440 BUILTIN(__builtin_bzero, "vv*z", "nF")
441 BUILTIN(__builtin_fprintf, "iP*cC*.", "Fp:1:")
442 BUILTIN(__builtin_memchr, "v*vC*iz", "nF")
443 BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF")
444 BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF")
445 BUILTIN(__builtin_memmove, "v*v*vC*z", "nF")
446 BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF")
447 BUILTIN(__builtin_memset, "v*v*iz", "nF")
448 BUILTIN(__builtin_printf, "icC*.", "Fp:0:")
449 BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF")
450 BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF")
451 BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF")
452 BUILTIN(__builtin_strcat, "c*c*cC*", "nF")
453 BUILTIN(__builtin_strchr, "c*cC*i", "nF")
454 BUILTIN(__builtin_strcmp, "icC*cC*", "nF")
455 BUILTIN(__builtin_strcpy, "c*c*cC*", "nF")
456 BUILTIN(__builtin_strcspn, "zcC*cC*", "nF")
457 BUILTIN(__builtin_strdup, "c*cC*", "nF")
458 BUILTIN(__builtin_strlen, "zcC*", "nF")
459 BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF")
460 BUILTIN(__builtin_strncat, "c*c*cC*z", "nF")
461 BUILTIN(__builtin_strncmp, "icC*cC*z", "nF")
462 BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF")
463 BUILTIN(__builtin_strndup, "c*cC*z", "nF")
464 BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF")
465 BUILTIN(__builtin_strrchr, "c*cC*i", "nF")
466 BUILTIN(__builtin_strspn, "zcC*cC*", "nF")
467 BUILTIN(__builtin_strstr, "c*cC*cC*", "nF")
468 BUILTIN(__builtin_wcschr, "w*wC*w", "nF")
469 BUILTIN(__builtin_wcscmp, "iwC*wC*", "nF")
470 BUILTIN(__builtin_wcslen, "zwC*", "nF")
471 BUILTIN(__builtin_wcsncmp, "iwC*wC*z", "nF")
472 BUILTIN(__builtin_wmemchr, "w*wC*wz", "nF")
473 BUILTIN(__builtin_wmemcmp, "iwC*wC*z", "nF")
474 BUILTIN(__builtin_return_address, "v*IUi", "n")
475 BUILTIN(__builtin_extract_return_addr, "v*v*", "n")
476 BUILTIN(__builtin_frame_address, "v*IUi", "n")
477 BUILTIN(__builtin___clear_cache, "vc*c*", "n")
478 BUILTIN(__builtin_flt_rounds, "i", "nc")
479 BUILTIN(__builtin_setjmp, "iv**", "j")
480 BUILTIN(__builtin_longjmp, "vv**i", "r")
481 BUILTIN(__builtin_unwind_init, "v", "")
482 BUILTIN(__builtin_eh_return_data_regno, "iIi", "nc")
483 BUILTIN(__builtin_snprintf, "ic*zcC*.", "nFp:2:")
484 BUILTIN(__builtin_vsprintf, "ic*cC*a", "nFP:1:")
485 BUILTIN(__builtin_vsnprintf, "ic*zcC*a", "nFP:2:")
486 BUILTIN(__builtin_thread_pointer, "v*", "nc")
487
488 // GCC exception builtins
489 BUILTIN(__builtin_eh_return, "vzv*", "r") // FIXME: Takes intptr_t, not size_t!
490 BUILTIN(__builtin_frob_return_addr, "v*v*", "n")
491 BUILTIN(__builtin_dwarf_cfa, "v*", "n")
492 BUILTIN(__builtin_init_dwarf_reg_size_table, "vv*", "n")
493 BUILTIN(__builtin_dwarf_sp_column, "Ui", "n")
494 BUILTIN(__builtin_extend_pointer, "ULLiv*", "n") // _Unwind_Word == uint64_t
495
496 // GCC Object size checking builtins
497 BUILTIN(__builtin_object_size, "zvC*i", "nu")
498 BUILTIN(__builtin___memcpy_chk, "v*v*vC*zz", "nF")
499 BUILTIN(__builtin___memccpy_chk, "v*v*vC*izz", "nF")
500 BUILTIN(__builtin___memmove_chk, "v*v*vC*zz", "nF")
501 BUILTIN(__builtin___mempcpy_chk, "v*v*vC*zz", "nF")
502 BUILTIN(__builtin___memset_chk, "v*v*izz", "nF")
503 BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF")
504 BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF")
505 BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF")
506 BUILTIN(__builtin___strlcat_chk, "zc*cC*zz", "nF")
507 BUILTIN(__builtin___strlcpy_chk, "zc*cC*zz", "nF")
508 BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF")
509 BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF")
510 BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz", "nF")
511 BUILTIN(__builtin___snprintf_chk, "ic*zizcC*.", "Fp:4:")
512 BUILTIN(__builtin___sprintf_chk, "ic*izcC*.", "Fp:3:")
513 BUILTIN(__builtin___vsnprintf_chk, "ic*zizcC*a", "FP:4:")
514 BUILTIN(__builtin___vsprintf_chk, "ic*izcC*a", "FP:3:")
515 BUILTIN(__builtin___fprintf_chk, "iP*icC*.", "Fp:2:")
516 BUILTIN(__builtin___printf_chk, "iicC*.", "Fp:1:")
517 BUILTIN(__builtin___vfprintf_chk, "iP*icC*a", "FP:2:")
518 BUILTIN(__builtin___vprintf_chk, "iicC*a", "FP:1:")
519
520 BUILTIN(__builtin_unpredictable, "LiLi"   , "nc")
521 BUILTIN(__builtin_expect, "LiLiLi"   , "nc")
522 BUILTIN(__builtin_prefetch, "vvC*.", "nc")
523 BUILTIN(__builtin_readcyclecounter, "ULLi", "n")
524 BUILTIN(__builtin_trap, "v", "nr")
525 BUILTIN(__builtin_debugtrap, "v", "n")
526 BUILTIN(__builtin_unreachable, "v", "nr")
527 BUILTIN(__builtin_shufflevector, "v."   , "nc")
528 BUILTIN(__builtin_convertvector, "v."   , "nct")
529 BUILTIN(__builtin_alloca, "v*z"   , "Fn")
530 BUILTIN(__builtin_alloca_with_align, "v*zIz", "Fn")
531 BUILTIN(__builtin_call_with_static_chain, "v.", "nt")
532
533 // "Overloaded" Atomic operator builtins.  These are overloaded to support data
534 // types of i8, i16, i32, i64, and i128.  The front-end sees calls to the
535 // non-suffixed version of these (which has a bogus type) and transforms them to
536 // the right overloaded version in Sema (plus casts).
537
538 // FIXME: These assume that char -> i8, short -> i16, int -> i32,
539 // long long -> i64.
540
541 BUILTIN(__sync_fetch_and_add, "v.", "t")
542 BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "nt")
543 BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "nt")
544 BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "nt")
545 BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "nt")
546 BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "nt")
547
548 BUILTIN(__sync_fetch_and_sub, "v.", "t")
549 BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "nt")
550 BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "nt")
551 BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "nt")
552 BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "nt")
553 BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "nt")
554
555 BUILTIN(__sync_fetch_and_or, "v.", "t")
556 BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "nt")
557 BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "nt")
558 BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "nt")
559 BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "nt")
560 BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "nt")
561
562 BUILTIN(__sync_fetch_and_and, "v.", "t")
563 BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "tn")
564 BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "tn")
565 BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "tn")
566 BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "tn")
567 BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "tn")
568
569 BUILTIN(__sync_fetch_and_xor, "v.", "t")
570 BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "tn")
571 BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "tn")
572 BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "tn")
573 BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "tn")
574 BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "tn")
575
576 BUILTIN(__sync_fetch_and_nand, "v.", "t")
577 BUILTIN(__sync_fetch_and_nand_1, "ccD*c.", "tn")
578 BUILTIN(__sync_fetch_and_nand_2, "ssD*s.", "tn")
579 BUILTIN(__sync_fetch_and_nand_4, "iiD*i.", "tn")
580 BUILTIN(__sync_fetch_and_nand_8, "LLiLLiD*LLi.", "tn")
581 BUILTIN(__sync_fetch_and_nand_16, "LLLiLLLiD*LLLi.", "tn")
582
583 BUILTIN(__sync_add_and_fetch, "v.", "t")
584 BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "tn")
585 BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "tn")
586 BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "tn")
587 BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "tn")
588 BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
589
590 BUILTIN(__sync_sub_and_fetch, "v.", "t")
591 BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "tn")
592 BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "tn")
593 BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "tn")
594 BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "tn")
595 BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
596
597 BUILTIN(__sync_or_and_fetch, "v.", "t")
598 BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "tn")
599 BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "tn")
600 BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "tn")
601 BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "tn")
602 BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
603
604 BUILTIN(__sync_and_and_fetch, "v.", "t")
605 BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "tn")
606 BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "tn")
607 BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "tn")
608 BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "tn")
609 BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
610
611 BUILTIN(__sync_xor_and_fetch, "v.", "t")
612 BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "tn")
613 BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "tn")
614 BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "tn")
615 BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "tn")
616 BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
617
618 BUILTIN(__sync_nand_and_fetch, "v.", "t")
619 BUILTIN(__sync_nand_and_fetch_1, "ccD*c.", "tn")
620 BUILTIN(__sync_nand_and_fetch_2, "ssD*s.", "tn")
621 BUILTIN(__sync_nand_and_fetch_4, "iiD*i.", "tn")
622 BUILTIN(__sync_nand_and_fetch_8, "LLiLLiD*LLi.", "tn")
623 BUILTIN(__sync_nand_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
624
625 BUILTIN(__sync_bool_compare_and_swap, "v.", "t")
626 BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "tn")
627 BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "tn")
628 BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "tn")
629 BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "tn")
630 BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "tn")
631
632 BUILTIN(__sync_val_compare_and_swap, "v.", "t")
633 BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "tn")
634 BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "tn")
635 BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "tn")
636 BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "tn")
637 BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "tn")
638
639 BUILTIN(__sync_lock_test_and_set, "v.", "t")
640 BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "tn")
641 BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "tn")
642 BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "tn")
643 BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "tn")
644 BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "tn")
645
646 BUILTIN(__sync_lock_release, "v.", "t")
647 BUILTIN(__sync_lock_release_1, "vcD*.", "tn")
648 BUILTIN(__sync_lock_release_2, "vsD*.", "tn")
649 BUILTIN(__sync_lock_release_4, "viD*.", "tn")
650 BUILTIN(__sync_lock_release_8, "vLLiD*.", "tn")
651 BUILTIN(__sync_lock_release_16, "vLLLiD*.", "tn")
652
653 BUILTIN(__sync_swap, "v.", "t")
654 BUILTIN(__sync_swap_1, "ccD*c.", "tn")
655 BUILTIN(__sync_swap_2, "ssD*s.", "tn")
656 BUILTIN(__sync_swap_4, "iiD*i.", "tn")
657 BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "tn")
658 BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "tn")
659
660 // Some of our atomics builtins are handled by AtomicExpr rather than
661 // as normal builtin CallExprs. This macro is used for such builtins.
662 #ifndef ATOMIC_BUILTIN
663 #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) BUILTIN(ID, TYPE, ATTRS)
664 #endif
665
666 // C11 _Atomic operations for <stdatomic.h>.
667 ATOMIC_BUILTIN(__c11_atomic_init, "v.", "t")
668 ATOMIC_BUILTIN(__c11_atomic_load, "v.", "t")
669 ATOMIC_BUILTIN(__c11_atomic_store, "v.", "t")
670 ATOMIC_BUILTIN(__c11_atomic_exchange, "v.", "t")
671 ATOMIC_BUILTIN(__c11_atomic_compare_exchange_strong, "v.", "t")
672 ATOMIC_BUILTIN(__c11_atomic_compare_exchange_weak, "v.", "t")
673 ATOMIC_BUILTIN(__c11_atomic_fetch_add, "v.", "t")
674 ATOMIC_BUILTIN(__c11_atomic_fetch_sub, "v.", "t")
675 ATOMIC_BUILTIN(__c11_atomic_fetch_and, "v.", "t")
676 ATOMIC_BUILTIN(__c11_atomic_fetch_or, "v.", "t")
677 ATOMIC_BUILTIN(__c11_atomic_fetch_xor, "v.", "t")
678 BUILTIN(__c11_atomic_thread_fence, "vi", "n")
679 BUILTIN(__c11_atomic_signal_fence, "vi", "n")
680 BUILTIN(__c11_atomic_is_lock_free, "iz", "n")
681
682 // GNU atomic builtins.
683 ATOMIC_BUILTIN(__atomic_load, "v.", "t")
684 ATOMIC_BUILTIN(__atomic_load_n, "v.", "t")
685 ATOMIC_BUILTIN(__atomic_store, "v.", "t")
686 ATOMIC_BUILTIN(__atomic_store_n, "v.", "t")
687 ATOMIC_BUILTIN(__atomic_exchange, "v.", "t")
688 ATOMIC_BUILTIN(__atomic_exchange_n, "v.", "t")
689 ATOMIC_BUILTIN(__atomic_compare_exchange, "v.", "t")
690 ATOMIC_BUILTIN(__atomic_compare_exchange_n, "v.", "t")
691 ATOMIC_BUILTIN(__atomic_fetch_add, "v.", "t")
692 ATOMIC_BUILTIN(__atomic_fetch_sub, "v.", "t")
693 ATOMIC_BUILTIN(__atomic_fetch_and, "v.", "t")
694 ATOMIC_BUILTIN(__atomic_fetch_or, "v.", "t")
695 ATOMIC_BUILTIN(__atomic_fetch_xor, "v.", "t")
696 ATOMIC_BUILTIN(__atomic_fetch_nand, "v.", "t")
697 ATOMIC_BUILTIN(__atomic_add_fetch, "v.", "t")
698 ATOMIC_BUILTIN(__atomic_sub_fetch, "v.", "t")
699 ATOMIC_BUILTIN(__atomic_and_fetch, "v.", "t")
700 ATOMIC_BUILTIN(__atomic_or_fetch, "v.", "t")
701 ATOMIC_BUILTIN(__atomic_xor_fetch, "v.", "t")
702 ATOMIC_BUILTIN(__atomic_nand_fetch, "v.", "t")
703 BUILTIN(__atomic_test_and_set, "bvD*i", "n")
704 BUILTIN(__atomic_clear, "vvD*i", "n")
705 BUILTIN(__atomic_thread_fence, "vi", "n")
706 BUILTIN(__atomic_signal_fence, "vi", "n")
707 BUILTIN(__atomic_always_lock_free, "izvCD*", "n")
708 BUILTIN(__atomic_is_lock_free, "izvCD*", "n")
709
710 // OpenCL 2.0 atomic builtins.
711 ATOMIC_BUILTIN(__opencl_atomic_init, "v.", "t")
712 ATOMIC_BUILTIN(__opencl_atomic_load, "v.", "t")
713 ATOMIC_BUILTIN(__opencl_atomic_store, "v.", "t")
714 ATOMIC_BUILTIN(__opencl_atomic_exchange, "v.", "t")
715 ATOMIC_BUILTIN(__opencl_atomic_compare_exchange_strong, "v.", "t")
716 ATOMIC_BUILTIN(__opencl_atomic_compare_exchange_weak, "v.", "t")
717 ATOMIC_BUILTIN(__opencl_atomic_fetch_add, "v.", "t")
718 ATOMIC_BUILTIN(__opencl_atomic_fetch_sub, "v.", "t")
719 ATOMIC_BUILTIN(__opencl_atomic_fetch_and, "v.", "t")
720 ATOMIC_BUILTIN(__opencl_atomic_fetch_or, "v.", "t")
721 ATOMIC_BUILTIN(__opencl_atomic_fetch_xor, "v.", "t")
722 ATOMIC_BUILTIN(__opencl_atomic_fetch_min, "v.", "t")
723 ATOMIC_BUILTIN(__opencl_atomic_fetch_max, "v.", "t")
724
725 // GCC does not support these, they are a Clang extension.
726 ATOMIC_BUILTIN(__atomic_fetch_min, "v.", "t")
727 ATOMIC_BUILTIN(__atomic_fetch_max, "v.", "t")
728
729 #undef ATOMIC_BUILTIN
730
731 // Non-overloaded atomic builtins.
732 BUILTIN(__sync_synchronize, "v", "n")
733 // GCC does not support these, they are a Clang extension.
734 BUILTIN(__sync_fetch_and_min, "iiD*i", "n")
735 BUILTIN(__sync_fetch_and_max, "iiD*i", "n")
736 BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui", "n")
737 BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui", "n")
738
739 // Random libc builtins.
740 BUILTIN(__builtin_abort, "v", "Fnr")
741 BUILTIN(__builtin_index, "c*cC*i", "Fn")
742 BUILTIN(__builtin_rindex, "c*cC*i", "Fn")
743
744 // Microsoft builtins.  These are only active with -fms-extensions.
745 LANGBUILTIN(_alloca,          "v*z", "n", ALL_MS_LANGUAGES)
746 LANGBUILTIN(__annotation,     "wC*.","n", ALL_MS_LANGUAGES)
747 LANGBUILTIN(__assume,         "vb",  "n", ALL_MS_LANGUAGES)
748 LANGBUILTIN(_bittest,                "UcNiC*Ni", "n", ALL_MS_LANGUAGES)
749 LANGBUILTIN(_bittestandcomplement,   "UcNi*Ni", "n", ALL_MS_LANGUAGES)
750 LANGBUILTIN(_bittestandreset,        "UcNi*Ni", "n", ALL_MS_LANGUAGES)
751 LANGBUILTIN(_bittestandset,          "UcNi*Ni", "n", ALL_MS_LANGUAGES)
752 LANGBUILTIN(_bittest64,              "UcWiC*Wi", "n", ALL_MS_LANGUAGES)
753 LANGBUILTIN(_bittestandcomplement64, "UcWi*Wi", "n", ALL_MS_LANGUAGES)
754 LANGBUILTIN(_bittestandreset64,      "UcWi*Wi", "n", ALL_MS_LANGUAGES)
755 LANGBUILTIN(_bittestandset64,        "UcWi*Wi", "n", ALL_MS_LANGUAGES)
756 LIBBUILTIN(_byteswap_ushort, "UsUs",     "fnc", "stdlib.h", ALL_MS_LANGUAGES)
757 LIBBUILTIN(_byteswap_ulong,  "UNiUNi",   "fnc", "stdlib.h", ALL_MS_LANGUAGES)
758 LIBBUILTIN(_byteswap_uint64, "ULLiULLi", "fnc", "stdlib.h", ALL_MS_LANGUAGES)
759 LANGBUILTIN(__debugbreak,     "v",   "n", ALL_MS_LANGUAGES)
760 LANGBUILTIN(__exception_code, "UNi", "n", ALL_MS_LANGUAGES)
761 LANGBUILTIN(_exception_code,  "UNi", "n", ALL_MS_LANGUAGES)
762 LANGBUILTIN(__exception_info, "v*",  "n", ALL_MS_LANGUAGES)
763 LANGBUILTIN(_exception_info,  "v*",  "n", ALL_MS_LANGUAGES)
764 LANGBUILTIN(__abnormal_termination, "i", "n", ALL_MS_LANGUAGES)
765 LANGBUILTIN(_abnormal_termination,  "i", "n", ALL_MS_LANGUAGES)
766 LANGBUILTIN(__GetExceptionInfo, "v*.", "ntu", ALL_MS_LANGUAGES)
767 LANGBUILTIN(_InterlockedAnd8,   "ccD*c",        "n", ALL_MS_LANGUAGES)
768 LANGBUILTIN(_InterlockedAnd16,  "ssD*s",        "n", ALL_MS_LANGUAGES)
769 LANGBUILTIN(_InterlockedAnd,    "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
770 LANGBUILTIN(_InterlockedCompareExchange8,   "ccD*cc",         "n", ALL_MS_LANGUAGES)
771 LANGBUILTIN(_InterlockedCompareExchange16,  "ssD*ss",         "n", ALL_MS_LANGUAGES)
772 LANGBUILTIN(_InterlockedCompareExchange,    "NiNiD*NiNi",     "n", ALL_MS_LANGUAGES)
773 LANGBUILTIN(_InterlockedCompareExchange64,  "LLiLLiD*LLiLLi", "n", ALL_MS_LANGUAGES)
774 LANGBUILTIN(_InterlockedCompareExchangePointer, "v*v*D*v*v*", "n", ALL_MS_LANGUAGES)
775 LANGBUILTIN(_InterlockedDecrement16,        "ssD*",     "n", ALL_MS_LANGUAGES)
776 LANGBUILTIN(_InterlockedDecrement,          "NiNiD*",   "n", ALL_MS_LANGUAGES)
777 LANGBUILTIN(_InterlockedExchange,           "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
778 LANGBUILTIN(_InterlockedExchange8,          "ccD*c",        "n", ALL_MS_LANGUAGES)
779 LANGBUILTIN(_InterlockedExchange16,         "ssD*s",        "n", ALL_MS_LANGUAGES)
780 LANGBUILTIN(_InterlockedExchangeAdd8,       "ccD*c",          "n", ALL_MS_LANGUAGES)
781 LANGBUILTIN(_InterlockedExchangeAdd16,      "ssD*s",          "n", ALL_MS_LANGUAGES)
782 LANGBUILTIN(_InterlockedExchangeAdd,        "NiNiD*Ni",       "n", ALL_MS_LANGUAGES)
783 LANGBUILTIN(_InterlockedExchangePointer,    "v*v*D*v*",   "n", ALL_MS_LANGUAGES)
784 LANGBUILTIN(_InterlockedExchangeSub8,   "ccD*c",        "n", ALL_MS_LANGUAGES)
785 LANGBUILTIN(_InterlockedExchangeSub16,  "ssD*s",        "n", ALL_MS_LANGUAGES)
786 LANGBUILTIN(_InterlockedExchangeSub,    "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
787 LANGBUILTIN(_InterlockedIncrement16,        "ssD*",     "n", ALL_MS_LANGUAGES)
788 LANGBUILTIN(_InterlockedIncrement,          "NiNiD*",   "n", ALL_MS_LANGUAGES)
789 LANGBUILTIN(_InterlockedOr8,  "ccD*c",        "n", ALL_MS_LANGUAGES)
790 LANGBUILTIN(_InterlockedOr16, "ssD*s",        "n", ALL_MS_LANGUAGES)
791 LANGBUILTIN(_InterlockedOr,   "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
792 LANGBUILTIN(_InterlockedXor8,  "ccD*c",       "n", ALL_MS_LANGUAGES)
793 LANGBUILTIN(_InterlockedXor16, "ssD*s",       "n", ALL_MS_LANGUAGES)
794 LANGBUILTIN(_InterlockedXor,   "NiNiD*Ni",    "n", ALL_MS_LANGUAGES)
795 LANGBUILTIN(_interlockedbittestandreset,     "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
796 LANGBUILTIN(_interlockedbittestandreset64,   "UcWiD*Wi", "n", ALL_MS_LANGUAGES)
797 LANGBUILTIN(_interlockedbittestandreset_acq, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
798 LANGBUILTIN(_interlockedbittestandreset_nf,  "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
799 LANGBUILTIN(_interlockedbittestandreset_rel, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
800 LANGBUILTIN(_interlockedbittestandset,       "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
801 LANGBUILTIN(_interlockedbittestandset64,     "UcWiD*Wi", "n", ALL_MS_LANGUAGES)
802 LANGBUILTIN(_interlockedbittestandset_acq,   "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
803 LANGBUILTIN(_interlockedbittestandset_nf,    "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
804 LANGBUILTIN(_interlockedbittestandset_rel,   "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
805 LANGBUILTIN(__noop,           "i.",  "n", ALL_MS_LANGUAGES)
806 LANGBUILTIN(__popcnt16, "UsUs",     "nc", ALL_MS_LANGUAGES)
807 LANGBUILTIN(__popcnt,   "UiUi",     "nc", ALL_MS_LANGUAGES)
808 LANGBUILTIN(__popcnt64, "ULLiULLi", "nc", ALL_MS_LANGUAGES)
809 LANGBUILTIN(_ReturnAddress, "v*", "n", ALL_MS_LANGUAGES)
810 LANGBUILTIN(_rotl8,  "UcUcUc",    "n", ALL_MS_LANGUAGES)
811 LANGBUILTIN(_rotl16, "UsUsUc",    "n", ALL_MS_LANGUAGES)
812 LANGBUILTIN(_rotl,   "UiUii",     "n", ALL_MS_LANGUAGES)
813 LANGBUILTIN(_lrotl,  "UNiUNii",   "n", ALL_MS_LANGUAGES)
814 LANGBUILTIN(_rotl64, "ULLiULLii", "n", ALL_MS_LANGUAGES)
815 LANGBUILTIN(_rotr8,  "UcUcUc",    "n", ALL_MS_LANGUAGES)
816 LANGBUILTIN(_rotr16, "UsUsUc",    "n", ALL_MS_LANGUAGES)
817 LANGBUILTIN(_rotr,   "UiUii",     "n", ALL_MS_LANGUAGES)
818 LANGBUILTIN(_lrotr,  "UNiUNii",   "n", ALL_MS_LANGUAGES)
819 LANGBUILTIN(_rotr64, "ULLiULLii", "n", ALL_MS_LANGUAGES)
820 LANGBUILTIN(__va_start,       "vc**.", "nt", ALL_MS_LANGUAGES)
821 LANGBUILTIN(__fastfail, "vUi",    "nr", ALL_MS_LANGUAGES)
822
823 // Microsoft library builtins.
824 LIBBUILTIN(_setjmpex, "iJ", "fj",   "setjmpex.h", ALL_MS_LANGUAGES)
825
826 // C99 library functions
827 // C99 stdarg.h
828 LIBBUILTIN(va_start, "vA.",       "fn",    "stdarg.h", ALL_LANGUAGES)
829 LIBBUILTIN(va_end, "vA",          "fn",    "stdarg.h", ALL_LANGUAGES)
830 LIBBUILTIN(va_copy, "vAA",        "fn",    "stdarg.h", ALL_LANGUAGES)
831 // C99 stdlib.h
832 LIBBUILTIN(abort, "v",            "fr",    "stdlib.h", ALL_LANGUAGES)
833 LIBBUILTIN(calloc, "v*zz",        "f",     "stdlib.h", ALL_LANGUAGES)
834 LIBBUILTIN(exit, "vi",            "fr",    "stdlib.h", ALL_LANGUAGES)
835 LIBBUILTIN(_Exit, "vi",           "fr",    "stdlib.h", ALL_LANGUAGES)
836 LIBBUILTIN(malloc, "v*z",         "f",     "stdlib.h", ALL_LANGUAGES)
837 LIBBUILTIN(realloc, "v*v*z",      "f",     "stdlib.h", ALL_LANGUAGES)
838 LIBBUILTIN(strtod, "dcC*c**",     "f",     "stdlib.h", ALL_LANGUAGES)
839 LIBBUILTIN(strtof, "fcC*c**",     "f",     "stdlib.h", ALL_LANGUAGES)
840 LIBBUILTIN(strtold, "LdcC*c**",   "f",     "stdlib.h", ALL_LANGUAGES)
841 LIBBUILTIN(strtol, "LicC*c**i",   "f",     "stdlib.h", ALL_LANGUAGES)
842 LIBBUILTIN(strtoll, "LLicC*c**i", "f",     "stdlib.h", ALL_LANGUAGES)
843 LIBBUILTIN(strtoul, "ULicC*c**i", "f",     "stdlib.h", ALL_LANGUAGES)
844 LIBBUILTIN(strtoull, "ULLicC*c**i", "f",   "stdlib.h", ALL_LANGUAGES)
845 // C99 string.h
846 LIBBUILTIN(memcpy, "v*v*vC*z",    "f",     "string.h", ALL_LANGUAGES)
847 LIBBUILTIN(memcmp, "ivC*vC*z",    "f",     "string.h", ALL_LANGUAGES)
848 LIBBUILTIN(memmove, "v*v*vC*z",   "f",     "string.h", ALL_LANGUAGES)
849 LIBBUILTIN(strcpy, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
850 LIBBUILTIN(strncpy, "c*c*cC*z",   "f",     "string.h", ALL_LANGUAGES)
851 LIBBUILTIN(strcmp, "icC*cC*",     "f",     "string.h", ALL_LANGUAGES)
852 LIBBUILTIN(strncmp, "icC*cC*z",   "f",     "string.h", ALL_LANGUAGES)
853 LIBBUILTIN(strcat, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
854 LIBBUILTIN(strncat, "c*c*cC*z",   "f",     "string.h", ALL_LANGUAGES)
855 LIBBUILTIN(strxfrm, "zc*cC*z",    "f",     "string.h", ALL_LANGUAGES)
856 LIBBUILTIN(memchr, "v*vC*iz",     "f",     "string.h", ALL_LANGUAGES)
857 LIBBUILTIN(strchr, "c*cC*i",      "f",     "string.h", ALL_LANGUAGES)
858 LIBBUILTIN(strcspn, "zcC*cC*",    "f",     "string.h", ALL_LANGUAGES)
859 LIBBUILTIN(strpbrk, "c*cC*cC*",   "f",     "string.h", ALL_LANGUAGES)
860 LIBBUILTIN(strrchr, "c*cC*i",     "f",     "string.h", ALL_LANGUAGES)
861 LIBBUILTIN(strspn, "zcC*cC*",     "f",     "string.h", ALL_LANGUAGES)
862 LIBBUILTIN(strstr, "c*cC*cC*",    "f",     "string.h", ALL_LANGUAGES)
863 LIBBUILTIN(strtok, "c*c*cC*",     "f",     "string.h", ALL_LANGUAGES)
864 LIBBUILTIN(memset, "v*v*iz",      "f",     "string.h", ALL_LANGUAGES)
865 LIBBUILTIN(strerror, "c*i",       "f",     "string.h", ALL_LANGUAGES)
866 LIBBUILTIN(strlen, "zcC*",        "f",     "string.h", ALL_LANGUAGES)
867 // C99 stdio.h
868 // FIXME: This list is incomplete.
869 LIBBUILTIN(printf, "icC*.",       "fp:0:", "stdio.h", ALL_LANGUAGES)
870 LIBBUILTIN(fprintf, "iP*cC*.",    "fp:1:", "stdio.h", ALL_LANGUAGES)
871 LIBBUILTIN(snprintf, "ic*zcC*.",  "fp:2:", "stdio.h", ALL_LANGUAGES)
872 LIBBUILTIN(sprintf, "ic*cC*.",    "fp:1:", "stdio.h", ALL_LANGUAGES)
873 LIBBUILTIN(vprintf, "icC*a",      "fP:0:", "stdio.h", ALL_LANGUAGES)
874 LIBBUILTIN(vfprintf, "iP*cC*a",   "fP:1:", "stdio.h", ALL_LANGUAGES)
875 LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h", ALL_LANGUAGES)
876 LIBBUILTIN(vsprintf, "ic*cC*a",   "fP:1:", "stdio.h", ALL_LANGUAGES)
877 LIBBUILTIN(scanf, "icC*R.",       "fs:0:", "stdio.h", ALL_LANGUAGES)
878 LIBBUILTIN(fscanf, "iP*RcC*R.",   "fs:1:", "stdio.h", ALL_LANGUAGES)
879 LIBBUILTIN(sscanf, "icC*RcC*R.",  "fs:1:", "stdio.h", ALL_LANGUAGES)
880 LIBBUILTIN(vscanf, "icC*Ra",      "fS:0:", "stdio.h", ALL_LANGUAGES)
881 LIBBUILTIN(vfscanf, "iP*RcC*Ra",  "fS:1:", "stdio.h", ALL_LANGUAGES)
882 LIBBUILTIN(vsscanf, "icC*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES)
883 LIBBUILTIN(fopen, "P*cC*cC*",     "f",     "stdio.h", ALL_LANGUAGES)
884 LIBBUILTIN(fread, "zv*zzP*",      "f",     "stdio.h", ALL_LANGUAGES)
885 LIBBUILTIN(fwrite, "zvC*zzP*",    "f",     "stdio.h", ALL_LANGUAGES)
886
887 // C99 ctype.h
888 LIBBUILTIN(isalnum, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
889 LIBBUILTIN(isalpha, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
890 LIBBUILTIN(isblank, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
891 LIBBUILTIN(iscntrl, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
892 LIBBUILTIN(isdigit, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
893 LIBBUILTIN(isgraph, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
894 LIBBUILTIN(islower, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
895 LIBBUILTIN(isprint, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
896 LIBBUILTIN(ispunct, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
897 LIBBUILTIN(isspace, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
898 LIBBUILTIN(isupper, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
899 LIBBUILTIN(isxdigit, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
900 LIBBUILTIN(tolower, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
901 LIBBUILTIN(toupper, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
902 // C99 wchar.h
903 // FIXME: This list is incomplete. We should cover at least the functions that
904 // take format strings.
905 LIBBUILTIN(wcschr,  "w*wC*w",   "f", "wchar.h", ALL_LANGUAGES)
906 LIBBUILTIN(wcscmp,  "iwC*wC*",  "f", "wchar.h", ALL_LANGUAGES)
907 LIBBUILTIN(wcslen,  "zwC*",     "f", "wchar.h", ALL_LANGUAGES)
908 LIBBUILTIN(wcsncmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
909 LIBBUILTIN(wmemchr, "w*wC*wz",  "f", "wchar.h", ALL_LANGUAGES)
910 LIBBUILTIN(wmemcmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
911
912 // C99
913 // In some systems setjmp is a macro that expands to _setjmp. We undefine
914 // it here to avoid having two identical LIBBUILTIN entries.
915 #undef setjmp
916 LIBBUILTIN(setjmp, "iJ",          "fj",    "setjmp.h", ALL_LANGUAGES)
917 LIBBUILTIN(longjmp, "vJi",        "fr",    "setjmp.h", ALL_LANGUAGES)
918
919 // Non-C library functions, active in GNU mode only.
920 // Functions with (returns_twice) attribute (marked as "j") are still active in
921 // all languages, because losing this attribute would result in miscompilation
922 // when these functions are used in non-GNU mode. PR16138.
923 LIBBUILTIN(alloca, "v*z",         "f",     "stdlib.h", ALL_GNU_LANGUAGES)
924 // POSIX string.h
925 LIBBUILTIN(stpcpy, "c*c*cC*",     "f",     "string.h", ALL_GNU_LANGUAGES)
926 LIBBUILTIN(stpncpy, "c*c*cC*z",   "f",     "string.h", ALL_GNU_LANGUAGES)
927 LIBBUILTIN(strdup, "c*cC*",       "f",     "string.h", ALL_GNU_LANGUAGES)
928 LIBBUILTIN(strndup, "c*cC*z",     "f",     "string.h", ALL_GNU_LANGUAGES)
929 // POSIX strings.h
930 LIBBUILTIN(index, "c*cC*i",       "f",     "strings.h", ALL_GNU_LANGUAGES)
931 LIBBUILTIN(rindex, "c*cC*i",      "f",     "strings.h", ALL_GNU_LANGUAGES)
932 LIBBUILTIN(bzero, "vv*z",         "f",     "strings.h", ALL_GNU_LANGUAGES)
933 // In some systems str[n]casejmp is a macro that expands to _str[n]icmp.
934 // We undefine then here to avoid wrong name.
935 #undef strcasecmp
936 #undef strncasecmp
937 LIBBUILTIN(strcasecmp, "icC*cC*", "f",     "strings.h", ALL_GNU_LANGUAGES)
938 LIBBUILTIN(strncasecmp, "icC*cC*z", "f",   "strings.h", ALL_GNU_LANGUAGES)
939 // POSIX unistd.h
940 LIBBUILTIN(_exit, "vi",           "fr",    "unistd.h", ALL_GNU_LANGUAGES)
941 LIBBUILTIN(vfork, "p",            "fj",    "unistd.h", ALL_LANGUAGES)
942 // POSIX setjmp.h
943
944 LIBBUILTIN(_setjmp, "iJ",         "fj",   "setjmp.h", ALL_LANGUAGES)
945 LIBBUILTIN(__sigsetjmp, "iSJi",   "fj",   "setjmp.h", ALL_LANGUAGES)
946 LIBBUILTIN(sigsetjmp, "iSJi",     "fj",   "setjmp.h", ALL_LANGUAGES)
947 LIBBUILTIN(setjmp_syscall, "iJ",  "fj",   "setjmp.h", ALL_LANGUAGES)
948 LIBBUILTIN(savectx, "iJ",         "fj",   "setjmp.h", ALL_LANGUAGES)
949 LIBBUILTIN(qsetjmp, "iJ",         "fj",   "setjmp.h", ALL_LANGUAGES)
950 LIBBUILTIN(getcontext, "iK*",     "fj",   "setjmp.h", ALL_LANGUAGES)
951
952 LIBBUILTIN(_longjmp, "vJi",       "fr",    "setjmp.h", ALL_GNU_LANGUAGES)
953 LIBBUILTIN(siglongjmp, "vSJi",    "fr",    "setjmp.h", ALL_GNU_LANGUAGES)
954 // non-standard but very common
955 LIBBUILTIN(strlcpy, "zc*cC*z",    "f",     "string.h", ALL_GNU_LANGUAGES)
956 LIBBUILTIN(strlcat, "zc*cC*z",    "f",     "string.h", ALL_GNU_LANGUAGES)
957 //   id objc_msgSend(id, SEL, ...)
958 LIBBUILTIN(objc_msgSend, "GGH.",   "f",     "objc/message.h", OBJC_LANG)
959 // long double objc_msgSend_fpret(id self, SEL op, ...)
960 LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG)
961 // _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...)
962 LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH.", "f", "objc/message.h", OBJC_LANG)
963 // void objc_msgSend_stret (id, SEL, ...)
964 LIBBUILTIN(objc_msgSend_stret, "vGH.", "f", "objc/message.h", OBJC_LANG)
965 // id objc_msgSendSuper(struct objc_super *super, SEL op, ...)
966 LIBBUILTIN(objc_msgSendSuper, "GM*H.", "f", "objc/message.h", OBJC_LANG)
967 // void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...)
968 LIBBUILTIN(objc_msgSendSuper_stret, "vM*H.", "f", "objc/message.h", OBJC_LANG)
969 //   id objc_getClass(const char *name)
970 LIBBUILTIN(objc_getClass, "GcC*",   "f",     "objc/runtime.h", OBJC_LANG)
971 //   id objc_getMetaClass(const char *name)
972 LIBBUILTIN(objc_getMetaClass, "GcC*",   "f", "objc/runtime.h", OBJC_LANG)
973 // void objc_enumerationMutation(id)
974 LIBBUILTIN(objc_enumerationMutation, "vG", "f", "objc/runtime.h", OBJC_LANG)
975
976 // id objc_read_weak(id *location)
977 LIBBUILTIN(objc_read_weak, "GG*", "f", "objc/objc-auto.h", OBJC_LANG)
978 // id objc_assign_weak(id value, id *location)
979 LIBBUILTIN(objc_assign_weak, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG)
980 // id objc_assign_ivar(id value, id dest, ptrdiff_t offset)
981 LIBBUILTIN(objc_assign_ivar, "GGGY", "f", "objc/objc-auto.h", OBJC_LANG)
982 // id objc_assign_global(id val, id *dest)
983 LIBBUILTIN(objc_assign_global, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG)
984 // id objc_assign_strongCast(id val, id *dest
985 LIBBUILTIN(objc_assign_strongCast, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG)
986
987 // id objc_exception_extract(void *localExceptionData)
988 LIBBUILTIN(objc_exception_extract, "Gv*", "f", "objc/objc-exception.h", OBJC_LANG)
989 // void objc_exception_try_enter(void *localExceptionData)
990 LIBBUILTIN(objc_exception_try_enter, "vv*", "f", "objc/objc-exception.h", OBJC_LANG)
991 // void objc_exception_try_exit(void *localExceptionData)
992 LIBBUILTIN(objc_exception_try_exit, "vv*", "f", "objc/objc-exception.h", OBJC_LANG)
993 // int objc_exception_match(Class exceptionClass, id exception)
994 LIBBUILTIN(objc_exception_match, "iGG", "f", "objc/objc-exception.h", OBJC_LANG)
995 // void objc_exception_throw(id exception)
996 LIBBUILTIN(objc_exception_throw, "vG", "f", "objc/objc-exception.h", OBJC_LANG)
997
998 // int objc_sync_enter(id obj)
999 LIBBUILTIN(objc_sync_enter, "iG", "f", "objc/objc-sync.h", OBJC_LANG)
1000 // int objc_sync_exit(id obj)
1001 LIBBUILTIN(objc_sync_exit, "iG", "f", "objc/objc-sync.h", OBJC_LANG)
1002
1003 BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z", "nF")
1004
1005 // void NSLog(NSString *fmt, ...)
1006 LIBBUILTIN(NSLog, "vG.", "fp:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG)
1007 // void NSLogv(NSString *fmt, va_list args)
1008 LIBBUILTIN(NSLogv, "vGa", "fP:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG)
1009
1010 // Builtin math library functions
1011 LIBBUILTIN(atan2, "ddd", "fne", "math.h", ALL_LANGUAGES)
1012 LIBBUILTIN(atan2f, "fff", "fne", "math.h", ALL_LANGUAGES)
1013 LIBBUILTIN(atan2l, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1014
1015 LIBBUILTIN(abs, "ii", "fnc", "stdlib.h", ALL_LANGUAGES)
1016 LIBBUILTIN(labs, "LiLi", "fnc", "stdlib.h", ALL_LANGUAGES)
1017 LIBBUILTIN(llabs, "LLiLLi", "fnc", "stdlib.h", ALL_LANGUAGES)
1018
1019 LIBBUILTIN(copysign, "ddd", "fnc", "math.h", ALL_LANGUAGES)
1020 LIBBUILTIN(copysignf, "fff", "fnc", "math.h", ALL_LANGUAGES)
1021 LIBBUILTIN(copysignl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES)
1022
1023 LIBBUILTIN(fabs, "dd", "fnc", "math.h", ALL_LANGUAGES)
1024 LIBBUILTIN(fabsf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1025 LIBBUILTIN(fabsl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1026
1027 // Some systems define finitef as alias of _finitef.
1028 #if defined (finitef)
1029 #undef finitef
1030 #endif
1031 LIBBUILTIN(finite, "id", "fnc", "math.h", GNU_LANG)
1032 LIBBUILTIN(finitef, "if", "fnc", "math.h", GNU_LANG)
1033 LIBBUILTIN(finitel, "iLd", "fnc", "math.h", GNU_LANG)
1034 // glibc's math.h generates calls to __finite
1035 LIBBUILTIN(__finite, "id", "fnc", "math.h", ALL_LANGUAGES)
1036 LIBBUILTIN(__finitef, "if", "fnc", "math.h", ALL_LANGUAGES)
1037 LIBBUILTIN(__finitel, "iLd", "fnc", "math.h", ALL_LANGUAGES)
1038
1039 LIBBUILTIN(fmod, "ddd", "fne", "math.h", ALL_LANGUAGES)
1040 LIBBUILTIN(fmodf, "fff", "fne", "math.h", ALL_LANGUAGES)
1041 LIBBUILTIN(fmodl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1042
1043 LIBBUILTIN(frexp, "ddi*", "fn", "math.h", ALL_LANGUAGES)
1044 LIBBUILTIN(frexpf, "ffi*", "fn", "math.h", ALL_LANGUAGES)
1045 LIBBUILTIN(frexpl, "LdLdi*", "fn", "math.h", ALL_LANGUAGES)
1046
1047 LIBBUILTIN(ldexp, "ddi", "fne", "math.h", ALL_LANGUAGES)
1048 LIBBUILTIN(ldexpf, "ffi", "fne", "math.h", ALL_LANGUAGES)
1049 LIBBUILTIN(ldexpl, "LdLdi", "fne", "math.h", ALL_LANGUAGES)
1050
1051 LIBBUILTIN(modf, "ddd*", "fn", "math.h", ALL_LANGUAGES)
1052 LIBBUILTIN(modff, "fff*", "fn", "math.h", ALL_LANGUAGES)
1053 LIBBUILTIN(modfl, "LdLdLd*", "fn", "math.h", ALL_LANGUAGES)
1054
1055 LIBBUILTIN(nan,  "dcC*", "fUn", "math.h", ALL_LANGUAGES)
1056 LIBBUILTIN(nanf, "fcC*", "fUn", "math.h", ALL_LANGUAGES)
1057 LIBBUILTIN(nanl, "LdcC*", "fUn", "math.h", ALL_LANGUAGES)
1058
1059 LIBBUILTIN(pow, "ddd", "fne", "math.h", ALL_LANGUAGES)
1060 LIBBUILTIN(powf, "fff", "fne", "math.h", ALL_LANGUAGES)
1061 LIBBUILTIN(powl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1062
1063 LIBBUILTIN(acos, "dd", "fne", "math.h", ALL_LANGUAGES)
1064 LIBBUILTIN(acosf, "ff", "fne", "math.h", ALL_LANGUAGES)
1065 LIBBUILTIN(acosl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1066
1067 LIBBUILTIN(acosh, "dd", "fne", "math.h", ALL_LANGUAGES)
1068 LIBBUILTIN(acoshf, "ff", "fne", "math.h", ALL_LANGUAGES)
1069 LIBBUILTIN(acoshl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1070
1071 LIBBUILTIN(asin, "dd", "fne", "math.h", ALL_LANGUAGES)
1072 LIBBUILTIN(asinf, "ff", "fne", "math.h", ALL_LANGUAGES)
1073 LIBBUILTIN(asinl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1074
1075 LIBBUILTIN(asinh, "dd", "fne", "math.h", ALL_LANGUAGES)
1076 LIBBUILTIN(asinhf, "ff", "fne", "math.h", ALL_LANGUAGES)
1077 LIBBUILTIN(asinhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1078
1079 LIBBUILTIN(atan, "dd", "fne", "math.h", ALL_LANGUAGES)
1080 LIBBUILTIN(atanf, "ff", "fne", "math.h", ALL_LANGUAGES)
1081 LIBBUILTIN(atanl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1082
1083 LIBBUILTIN(atanh, "dd", "fne", "math.h", ALL_LANGUAGES)
1084 LIBBUILTIN(atanhf, "ff", "fne", "math.h", ALL_LANGUAGES)
1085 LIBBUILTIN(atanhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1086
1087 LIBBUILTIN(cbrt, "dd", "fnc", "math.h", ALL_LANGUAGES)
1088 LIBBUILTIN(cbrtf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1089 LIBBUILTIN(cbrtl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1090
1091 LIBBUILTIN(ceil, "dd", "fnc", "math.h", ALL_LANGUAGES)
1092 LIBBUILTIN(ceilf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1093 LIBBUILTIN(ceill, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1094
1095 LIBBUILTIN(cos, "dd", "fne", "math.h", ALL_LANGUAGES)
1096 LIBBUILTIN(cosf, "ff", "fne", "math.h", ALL_LANGUAGES)
1097 LIBBUILTIN(cosl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1098
1099 LIBBUILTIN(cosh, "dd", "fne", "math.h", ALL_LANGUAGES)
1100 LIBBUILTIN(coshf, "ff", "fne", "math.h", ALL_LANGUAGES)
1101 LIBBUILTIN(coshl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1102
1103 LIBBUILTIN(erf, "dd", "fne", "math.h", ALL_LANGUAGES)
1104 LIBBUILTIN(erff, "ff", "fne", "math.h", ALL_LANGUAGES)
1105 LIBBUILTIN(erfl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1106
1107 LIBBUILTIN(erfc, "dd", "fne", "math.h", ALL_LANGUAGES)
1108 LIBBUILTIN(erfcf, "ff", "fne", "math.h", ALL_LANGUAGES)
1109 LIBBUILTIN(erfcl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1110
1111 LIBBUILTIN(exp, "dd", "fne", "math.h", ALL_LANGUAGES)
1112 LIBBUILTIN(expf, "ff", "fne", "math.h", ALL_LANGUAGES)
1113 LIBBUILTIN(expl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1114
1115 LIBBUILTIN(exp2, "dd", "fne", "math.h", ALL_LANGUAGES)
1116 LIBBUILTIN(exp2f, "ff", "fne", "math.h", ALL_LANGUAGES)
1117 LIBBUILTIN(exp2l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1118
1119 LIBBUILTIN(expm1, "dd", "fne", "math.h", ALL_LANGUAGES)
1120 LIBBUILTIN(expm1f, "ff", "fne", "math.h", ALL_LANGUAGES)
1121 LIBBUILTIN(expm1l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1122
1123 LIBBUILTIN(fdim, "ddd", "fne", "math.h", ALL_LANGUAGES)
1124 LIBBUILTIN(fdimf, "fff", "fne", "math.h", ALL_LANGUAGES)
1125 LIBBUILTIN(fdiml, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1126
1127 LIBBUILTIN(floor, "dd", "fnc", "math.h", ALL_LANGUAGES)
1128 LIBBUILTIN(floorf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1129 LIBBUILTIN(floorl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1130
1131 LIBBUILTIN(fma, "dddd", "fne", "math.h", ALL_LANGUAGES)
1132 LIBBUILTIN(fmaf, "ffff", "fne", "math.h", ALL_LANGUAGES)
1133 LIBBUILTIN(fmal, "LdLdLdLd", "fne", "math.h", ALL_LANGUAGES)
1134
1135 LIBBUILTIN(fmax, "ddd", "fnc", "math.h", ALL_LANGUAGES)
1136 LIBBUILTIN(fmaxf, "fff", "fnc", "math.h", ALL_LANGUAGES)
1137 LIBBUILTIN(fmaxl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES)
1138
1139 LIBBUILTIN(fmin, "ddd", "fnc", "math.h", ALL_LANGUAGES)
1140 LIBBUILTIN(fminf, "fff", "fnc", "math.h", ALL_LANGUAGES)
1141 LIBBUILTIN(fminl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES)
1142
1143 LIBBUILTIN(hypot, "ddd", "fne", "math.h", ALL_LANGUAGES)
1144 LIBBUILTIN(hypotf, "fff", "fne", "math.h", ALL_LANGUAGES)
1145 LIBBUILTIN(hypotl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1146
1147 LIBBUILTIN(ilogb, "id", "fne", "math.h", ALL_LANGUAGES)
1148 LIBBUILTIN(ilogbf, "if", "fne", "math.h", ALL_LANGUAGES)
1149 LIBBUILTIN(ilogbl, "iLd", "fne", "math.h", ALL_LANGUAGES)
1150
1151 // POSIX math.h declares a global, signgam, that lgamma writes to, so these
1152 // shouldn't have "e" or "c" attributes
1153 LIBBUILTIN(lgamma, "dd", "fn", "math.h", ALL_LANGUAGES)
1154 LIBBUILTIN(lgammaf, "ff", "fn", "math.h", ALL_LANGUAGES)
1155 LIBBUILTIN(lgammal, "LdLd", "fn", "math.h", ALL_LANGUAGES)
1156
1157 LIBBUILTIN(llrint, "LLid", "fne", "math.h", ALL_LANGUAGES)
1158 LIBBUILTIN(llrintf, "LLif", "fne", "math.h", ALL_LANGUAGES)
1159 LIBBUILTIN(llrintl, "LLiLd", "fne", "math.h", ALL_LANGUAGES)
1160
1161 LIBBUILTIN(llround, "LLid", "fne", "math.h", ALL_LANGUAGES)
1162 LIBBUILTIN(llroundf, "LLif", "fne", "math.h", ALL_LANGUAGES)
1163 LIBBUILTIN(llroundl, "LLiLd", "fne", "math.h", ALL_LANGUAGES)
1164
1165 LIBBUILTIN(log, "dd", "fne", "math.h", ALL_LANGUAGES)
1166 LIBBUILTIN(logf, "ff", "fne", "math.h", ALL_LANGUAGES)
1167 LIBBUILTIN(logl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1168
1169 LIBBUILTIN(log10, "dd", "fne", "math.h", ALL_LANGUAGES)
1170 LIBBUILTIN(log10f, "ff", "fne", "math.h", ALL_LANGUAGES)
1171 LIBBUILTIN(log10l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1172
1173 LIBBUILTIN(log1p, "dd", "fne", "math.h", ALL_LANGUAGES)
1174 LIBBUILTIN(log1pf, "ff", "fne", "math.h", ALL_LANGUAGES)
1175 LIBBUILTIN(log1pl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1176
1177 LIBBUILTIN(log2, "dd", "fne", "math.h", ALL_LANGUAGES)
1178 LIBBUILTIN(log2f, "ff", "fne", "math.h", ALL_LANGUAGES)
1179 LIBBUILTIN(log2l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1180
1181 LIBBUILTIN(logb, "dd", "fne", "math.h", ALL_LANGUAGES)
1182 LIBBUILTIN(logbf, "ff", "fne", "math.h", ALL_LANGUAGES)
1183 LIBBUILTIN(logbl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1184
1185 LIBBUILTIN(lrint, "Lid", "fne", "math.h", ALL_LANGUAGES)
1186 LIBBUILTIN(lrintf, "Lif", "fne", "math.h", ALL_LANGUAGES)
1187 LIBBUILTIN(lrintl, "LiLd", "fne", "math.h", ALL_LANGUAGES)
1188
1189 LIBBUILTIN(lround, "Lid", "fne", "math.h", ALL_LANGUAGES)
1190 LIBBUILTIN(lroundf, "Lif", "fne", "math.h", ALL_LANGUAGES)
1191 LIBBUILTIN(lroundl, "LiLd", "fne", "math.h", ALL_LANGUAGES)
1192
1193 LIBBUILTIN(nearbyint, "dd", "fnc", "math.h", ALL_LANGUAGES)
1194 LIBBUILTIN(nearbyintf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1195 LIBBUILTIN(nearbyintl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1196
1197 LIBBUILTIN(nextafter, "ddd", "fne", "math.h", ALL_LANGUAGES)
1198 LIBBUILTIN(nextafterf, "fff", "fne", "math.h", ALL_LANGUAGES)
1199 LIBBUILTIN(nextafterl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1200
1201 LIBBUILTIN(nexttoward, "ddLd", "fne", "math.h", ALL_LANGUAGES)
1202 LIBBUILTIN(nexttowardf, "ffLd", "fne", "math.h", ALL_LANGUAGES)
1203 LIBBUILTIN(nexttowardl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1204
1205 LIBBUILTIN(remainder, "ddd", "fne", "math.h", ALL_LANGUAGES)
1206 LIBBUILTIN(remainderf, "fff", "fne", "math.h", ALL_LANGUAGES)
1207 LIBBUILTIN(remainderl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
1208
1209 LIBBUILTIN(remquo, "dddi*", "fn", "math.h", ALL_LANGUAGES)
1210 LIBBUILTIN(remquof, "fffi*", "fn", "math.h", ALL_LANGUAGES)
1211 LIBBUILTIN(remquol, "LdLdLdi*", "fn", "math.h", ALL_LANGUAGES)
1212
1213 LIBBUILTIN(rint, "dd", "fnc", "math.h", ALL_LANGUAGES)
1214 LIBBUILTIN(rintf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1215 LIBBUILTIN(rintl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1216
1217 LIBBUILTIN(round, "dd", "fnc", "math.h", ALL_LANGUAGES)
1218 LIBBUILTIN(roundf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1219 LIBBUILTIN(roundl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1220
1221 LIBBUILTIN(scalbln, "ddLi", "fne", "math.h", ALL_LANGUAGES)
1222 LIBBUILTIN(scalblnf, "ffLi", "fne", "math.h", ALL_LANGUAGES)
1223 LIBBUILTIN(scalblnl, "LdLdLi", "fne", "math.h", ALL_LANGUAGES)
1224
1225 LIBBUILTIN(scalbn, "ddi", "fne", "math.h", ALL_LANGUAGES)
1226 LIBBUILTIN(scalbnf, "ffi", "fne", "math.h", ALL_LANGUAGES)
1227 LIBBUILTIN(scalbnl, "LdLdi", "fne", "math.h", ALL_LANGUAGES)
1228
1229 LIBBUILTIN(sin, "dd", "fne", "math.h", ALL_LANGUAGES)
1230 LIBBUILTIN(sinf, "ff", "fne", "math.h", ALL_LANGUAGES)
1231 LIBBUILTIN(sinl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1232
1233 LIBBUILTIN(sinh, "dd", "fne", "math.h", ALL_LANGUAGES)
1234 LIBBUILTIN(sinhf, "ff", "fne", "math.h", ALL_LANGUAGES)
1235 LIBBUILTIN(sinhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1236
1237 LIBBUILTIN(sqrt, "dd", "fne", "math.h", ALL_LANGUAGES)
1238 LIBBUILTIN(sqrtf, "ff", "fne", "math.h", ALL_LANGUAGES)
1239 LIBBUILTIN(sqrtl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1240
1241 LIBBUILTIN(tan, "dd", "fne", "math.h", ALL_LANGUAGES)
1242 LIBBUILTIN(tanf, "ff", "fne", "math.h", ALL_LANGUAGES)
1243 LIBBUILTIN(tanl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1244
1245 LIBBUILTIN(tanh, "dd", "fne", "math.h", ALL_LANGUAGES)
1246 LIBBUILTIN(tanhf, "ff", "fne", "math.h", ALL_LANGUAGES)
1247 LIBBUILTIN(tanhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1248
1249 LIBBUILTIN(tgamma, "dd", "fne", "math.h", ALL_LANGUAGES)
1250 LIBBUILTIN(tgammaf, "ff", "fne", "math.h", ALL_LANGUAGES)
1251 LIBBUILTIN(tgammal, "LdLd", "fne", "math.h", ALL_LANGUAGES)
1252
1253 LIBBUILTIN(trunc, "dd", "fnc", "math.h", ALL_LANGUAGES)
1254 LIBBUILTIN(truncf, "ff", "fnc", "math.h", ALL_LANGUAGES)
1255 LIBBUILTIN(truncl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
1256
1257 LIBBUILTIN(cabs, "dXd", "fne", "complex.h", ALL_LANGUAGES)
1258 LIBBUILTIN(cabsf, "fXf", "fne", "complex.h", ALL_LANGUAGES)
1259 LIBBUILTIN(cabsl, "LdXLd", "fne", "complex.h", ALL_LANGUAGES)
1260
1261 LIBBUILTIN(cacos, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1262 LIBBUILTIN(cacosf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1263 LIBBUILTIN(cacosl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1264
1265 LIBBUILTIN(cacosh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1266 LIBBUILTIN(cacoshf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1267 LIBBUILTIN(cacoshl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1268
1269 LIBBUILTIN(carg, "dXd", "fne", "complex.h", ALL_LANGUAGES)
1270 LIBBUILTIN(cargf, "fXf", "fne", "complex.h", ALL_LANGUAGES)
1271 LIBBUILTIN(cargl, "LdXLd", "fne", "complex.h", ALL_LANGUAGES)
1272
1273 LIBBUILTIN(casin, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1274 LIBBUILTIN(casinf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1275 LIBBUILTIN(casinl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1276
1277 LIBBUILTIN(casinh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1278 LIBBUILTIN(casinhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1279 LIBBUILTIN(casinhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1280
1281 LIBBUILTIN(catan, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1282 LIBBUILTIN(catanf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1283 LIBBUILTIN(catanl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1284
1285 LIBBUILTIN(catanh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1286 LIBBUILTIN(catanhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1287 LIBBUILTIN(catanhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1288
1289 LIBBUILTIN(ccos, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1290 LIBBUILTIN(ccosf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1291 LIBBUILTIN(ccosl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1292
1293 LIBBUILTIN(ccosh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1294 LIBBUILTIN(ccoshf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1295 LIBBUILTIN(ccoshl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1296
1297 LIBBUILTIN(cexp, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1298 LIBBUILTIN(cexpf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1299 LIBBUILTIN(cexpl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1300
1301 LIBBUILTIN(cimag, "dXd", "fnc", "complex.h", ALL_LANGUAGES)
1302 LIBBUILTIN(cimagf, "fXf", "fnc", "complex.h", ALL_LANGUAGES)
1303 LIBBUILTIN(cimagl, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES)
1304
1305 LIBBUILTIN(conj, "XdXd", "fnc", "complex.h", ALL_LANGUAGES)
1306 LIBBUILTIN(conjf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES)
1307 LIBBUILTIN(conjl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES)
1308
1309 LIBBUILTIN(clog, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1310 LIBBUILTIN(clogf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1311 LIBBUILTIN(clogl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1312
1313 LIBBUILTIN(cproj, "XdXd", "fnc", "complex.h", ALL_LANGUAGES)
1314 LIBBUILTIN(cprojf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES)
1315 LIBBUILTIN(cprojl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES)
1316
1317 LIBBUILTIN(cpow, "XdXdXd", "fne", "complex.h", ALL_LANGUAGES)
1318 LIBBUILTIN(cpowf, "XfXfXf", "fne", "complex.h", ALL_LANGUAGES)
1319 LIBBUILTIN(cpowl, "XLdXLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1320
1321 LIBBUILTIN(creal, "dXd", "fnc", "complex.h", ALL_LANGUAGES)
1322 LIBBUILTIN(crealf, "fXf", "fnc", "complex.h", ALL_LANGUAGES)
1323 LIBBUILTIN(creall, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES)
1324
1325 LIBBUILTIN(csin, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1326 LIBBUILTIN(csinf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1327 LIBBUILTIN(csinl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1328
1329 LIBBUILTIN(csinh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1330 LIBBUILTIN(csinhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1331 LIBBUILTIN(csinhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1332
1333 LIBBUILTIN(csqrt, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1334 LIBBUILTIN(csqrtf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1335 LIBBUILTIN(csqrtl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1336
1337 LIBBUILTIN(ctan, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1338 LIBBUILTIN(ctanf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1339 LIBBUILTIN(ctanl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1340
1341 LIBBUILTIN(ctanh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
1342 LIBBUILTIN(ctanhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
1343 LIBBUILTIN(ctanhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
1344
1345 // __sinpi and friends are OS X specific library functions, but otherwise much
1346 // like the standard (non-complex) sin (etc).
1347 LIBBUILTIN(__sinpi, "dd", "fne", "math.h", ALL_LANGUAGES)
1348 LIBBUILTIN(__sinpif, "ff", "fne", "math.h", ALL_LANGUAGES)
1349
1350 LIBBUILTIN(__cospi, "dd", "fne", "math.h", ALL_LANGUAGES)
1351 LIBBUILTIN(__cospif, "ff", "fne", "math.h", ALL_LANGUAGES)
1352
1353 LIBBUILTIN(__tanpi, "dd", "fne", "math.h", ALL_LANGUAGES)
1354 LIBBUILTIN(__tanpif, "ff", "fne", "math.h", ALL_LANGUAGES)
1355
1356 // Similarly, __exp10 is OS X only
1357 LIBBUILTIN(__exp10, "dd", "fne", "math.h", ALL_LANGUAGES)
1358 LIBBUILTIN(__exp10f, "ff", "fne", "math.h", ALL_LANGUAGES)
1359
1360 // Blocks runtime Builtin math library functions
1361 LIBBUILTIN(_Block_object_assign, "vv*vC*iC", "f", "Blocks.h", ALL_LANGUAGES)
1362 LIBBUILTIN(_Block_object_dispose, "vvC*iC", "f", "Blocks.h", ALL_LANGUAGES)
1363 // FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock.
1364
1365 // Annotation function
1366 BUILTIN(__builtin_annotation, "v.", "tn")
1367
1368 // Invariants
1369 BUILTIN(__builtin_assume, "vb", "n")
1370
1371 // Multiprecision Arithmetic Builtins.
1372 BUILTIN(__builtin_addcb, "UcUcCUcCUcCUc*", "n")
1373 BUILTIN(__builtin_addcs, "UsUsCUsCUsCUs*", "n")
1374 BUILTIN(__builtin_addc, "UiUiCUiCUiCUi*", "n")
1375 BUILTIN(__builtin_addcl, "ULiULiCULiCULiCULi*", "n")
1376 BUILTIN(__builtin_addcll, "ULLiULLiCULLiCULLiCULLi*", "n")
1377 BUILTIN(__builtin_subcb, "UcUcCUcCUcCUc*", "n")
1378 BUILTIN(__builtin_subcs, "UsUsCUsCUsCUs*", "n")
1379 BUILTIN(__builtin_subc, "UiUiCUiCUiCUi*", "n")
1380 BUILTIN(__builtin_subcl, "ULiULiCULiCULiCULi*", "n")
1381 BUILTIN(__builtin_subcll, "ULLiULLiCULLiCULLiCULLi*", "n")
1382
1383 // Checked Arithmetic Builtins for Security.
1384 BUILTIN(__builtin_add_overflow, "v.", "nt")
1385 BUILTIN(__builtin_sub_overflow, "v.", "nt")
1386 BUILTIN(__builtin_mul_overflow, "v.", "nt")
1387 BUILTIN(__builtin_uadd_overflow, "bUiCUiCUi*", "n")
1388 BUILTIN(__builtin_uaddl_overflow, "bULiCULiCULi*", "n")
1389 BUILTIN(__builtin_uaddll_overflow, "bULLiCULLiCULLi*", "n")
1390 BUILTIN(__builtin_usub_overflow, "bUiCUiCUi*", "n")
1391 BUILTIN(__builtin_usubl_overflow, "bULiCULiCULi*", "n")
1392 BUILTIN(__builtin_usubll_overflow, "bULLiCULLiCULLi*", "n")
1393 BUILTIN(__builtin_umul_overflow, "bUiCUiCUi*", "n")
1394 BUILTIN(__builtin_umull_overflow, "bULiCULiCULi*", "n")
1395 BUILTIN(__builtin_umulll_overflow, "bULLiCULLiCULLi*", "n")
1396 BUILTIN(__builtin_sadd_overflow, "bSiCSiCSi*", "n")
1397 BUILTIN(__builtin_saddl_overflow, "bSLiCSLiCSLi*", "n")
1398 BUILTIN(__builtin_saddll_overflow, "bSLLiCSLLiCSLLi*", "n")
1399 BUILTIN(__builtin_ssub_overflow, "bSiCSiCSi*", "n")
1400 BUILTIN(__builtin_ssubl_overflow, "bSLiCSLiCSLi*", "n")
1401 BUILTIN(__builtin_ssubll_overflow, "bSLLiCSLLiCSLLi*", "n")
1402 BUILTIN(__builtin_smul_overflow, "bSiCSiCSi*", "n")
1403 BUILTIN(__builtin_smull_overflow, "bSLiCSLiCSLi*", "n")
1404 BUILTIN(__builtin_smulll_overflow, "bSLLiCSLLiCSLLi*", "n")
1405
1406 // Clang builtins (not available in GCC).
1407 BUILTIN(__builtin_addressof, "v*v&", "nct")
1408 BUILTIN(__builtin_operator_new, "v*z", "tc")
1409 BUILTIN(__builtin_operator_delete, "vv*", "tn")
1410 BUILTIN(__builtin_char_memchr, "c*cC*iz", "n")
1411 BUILTIN(__builtin_dump_struct, "ivC*v*", "tn")
1412
1413 // Safestack builtins
1414 BUILTIN(__builtin___get_unsafe_stack_start, "v*", "Fn")
1415 BUILTIN(__builtin___get_unsafe_stack_bottom, "v*", "Fn")
1416 BUILTIN(__builtin___get_unsafe_stack_top, "v*", "Fn")
1417 BUILTIN(__builtin___get_unsafe_stack_ptr, "v*", "Fn")
1418
1419 // Nontemporal loads/stores builtins
1420 BUILTIN(__builtin_nontemporal_store, "v.", "t")
1421 BUILTIN(__builtin_nontemporal_load, "v.", "t")
1422
1423 // Coroutine intrinsics.
1424 BUILTIN(__builtin_coro_resume, "vv*", "")
1425 BUILTIN(__builtin_coro_destroy, "vv*", "")
1426 BUILTIN(__builtin_coro_done, "bv*", "n")
1427 BUILTIN(__builtin_coro_promise, "v*v*IiIb", "n")
1428
1429 BUILTIN(__builtin_coro_size, "z", "n")
1430 BUILTIN(__builtin_coro_frame, "v*", "n")
1431 BUILTIN(__builtin_coro_noop, "v*", "n")
1432 BUILTIN(__builtin_coro_free, "v*v*", "n")
1433
1434 BUILTIN(__builtin_coro_id, "v*Iiv*v*v*", "n")
1435 BUILTIN(__builtin_coro_alloc, "b", "n")
1436 BUILTIN(__builtin_coro_begin, "v*v*", "n")
1437 BUILTIN(__builtin_coro_end, "bv*Ib", "n")
1438 BUILTIN(__builtin_coro_suspend, "cIb", "n")
1439 BUILTIN(__builtin_coro_param, "bv*v*", "n")
1440 // OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions.
1441 // We need the generic prototype, since the packet type could be anything.
1442 LANGBUILTIN(read_pipe, "i.", "tn", OCLC20_LANG)
1443 LANGBUILTIN(write_pipe, "i.", "tn", OCLC20_LANG)
1444
1445 LANGBUILTIN(reserve_read_pipe, "i.", "tn", OCLC20_LANG)
1446 LANGBUILTIN(reserve_write_pipe, "i.", "tn", OCLC20_LANG)
1447
1448 LANGBUILTIN(commit_write_pipe, "v.", "tn", OCLC20_LANG)
1449 LANGBUILTIN(commit_read_pipe, "v.", "tn", OCLC20_LANG)
1450
1451 LANGBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG)
1452 LANGBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG)
1453
1454 LANGBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCLC20_LANG)
1455 LANGBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCLC20_LANG)
1456
1457 LANGBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG)
1458 LANGBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG)
1459
1460 LANGBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCLC20_LANG)
1461 LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC20_LANG)
1462
1463 LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC20_LANG)
1464 LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC20_LANG)
1465
1466 // OpenCL v2.0 s6.13.17 - Enqueue kernel functions.
1467 // Custom builtin check allows to perform special check of passed block arguments.
1468 LANGBUILTIN(enqueue_kernel, "i.", "tn", OCLC20_LANG)
1469 LANGBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCLC20_LANG)
1470 LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn", OCLC20_LANG)
1471 LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn", OCLC20_LANG)
1472 LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC20_LANG)
1473
1474 // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
1475 LANGBUILTIN(to_global, "v*v*", "tn", OCLC20_LANG)
1476 LANGBUILTIN(to_local, "v*v*", "tn", OCLC20_LANG)
1477 LANGBUILTIN(to_private, "v*v*", "tn", OCLC20_LANG)
1478
1479 // OpenCL half load/store builtin
1480 LANGBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCLC_LANGUAGES)
1481 LANGBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCLC_LANGUAGES)
1482 LANGBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCLC_LANGUAGES)
1483 LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES)
1484
1485 // Builtins for os_log/os_trace
1486 BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut")
1487 BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt")
1488
1489 // OpenMP 4.0
1490 LANGBUILTIN(omp_is_initial_device, "i", "nc", OMP_LANG)
1491
1492 // Builtins for XRay
1493 BUILTIN(__xray_customevent, "vcC*z", "")
1494 BUILTIN(__xray_typedevent, "vzcC*z", "")
1495
1496 // Win64-compatible va_list functions
1497 BUILTIN(__builtin_ms_va_start, "vc*&.", "nt")
1498 BUILTIN(__builtin_ms_va_end, "vc*&", "n")
1499 BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n")
1500
1501 #undef BUILTIN
1502 #undef LIBBUILTIN
1503 #undef LANGBUILTIN