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