From 695a2d8d1aacec5897cad0526d8818e44ce72d4c Mon Sep 17 00:00:00 2001 From: Andre Maroneze <andre.maroneze@cea.fr> Date: Thu, 13 Jan 2022 20:51:12 +0100 Subject: [PATCH] [Kernel] split GCC builtins JSON file for performance reasons --- Makefile | 2 + headers/header_spec.txt | 1 + share/compliance/compiler_builtins.json | 1837 +---------------- share/compliance/gcc_builtins.json | 1252 +++++++++++ src/kernel_internals/runtime/special_hooks.ml | 6 +- .../ast_queries/cil_builtins.ml | 55 +- .../ast_queries/cil_builtins.mli | 4 + tests/compliance/check-json.i | 3 +- tests/compliance/oracle/json_check-json_5.txt | 2 +- tests/compliance/oracle/json_check-json_6.txt | 4 +- tests/compliance/oracle/json_check-json_7.txt | 2 + 11 files changed, 1325 insertions(+), 1843 deletions(-) create mode 100644 share/compliance/gcc_builtins.json create mode 100644 tests/compliance/oracle/json_check-json_7.txt diff --git a/Makefile b/Makefile index 3a6699dac5f..c4185f9379a 100644 --- a/Makefile +++ b/Makefile @@ -292,6 +292,7 @@ DISTRIB_FILES:=\ share/compliance/c11_functions.json \ share/compliance/c11_headers.json \ share/compliance/compiler_builtins.json \ + share/compliance/gcc_builtins.json \ share/compliance/glibc_functions.json \ share/compliance/nonstandard_identifiers.json \ share/compliance/posix_identifiers.json \ @@ -2009,6 +2010,7 @@ install:: install-lib-$(OCAMLBEST) $(CP) share/compliance/c11_functions.json \ share/compliance/c11_headers.json \ share/compliance/compiler_builtins.json \ + share/compliance/gcc_builtins.json \ share/compliance/glibc_functions.json \ share/compliance/nonstandard_identifiers.json \ share/compliance/posix_identifiers.json \ diff --git a/headers/header_spec.txt b/headers/header_spec.txt index c7249748760..75a8014972c 100644 --- a/headers/header_spec.txt +++ b/headers/header_spec.txt @@ -149,6 +149,7 @@ share/analysis-scripts/template.mk: .ignore share/compliance/c11_functions.json: .ignore share/compliance/c11_headers.json: .ignore share/compliance/compiler_builtins.json: .ignore +share/compliance/gcc_builtins.json: .ignore share/compliance/glibc_functions.json: .ignore share/compliance/nonstandard_identifiers.json: .ignore share/compliance/posix_identifiers.json: .ignore diff --git a/share/compliance/compiler_builtins.json b/share/compliance/compiler_builtins.json index cb51df655d7..2aca1737576 100644 --- a/share/compliance/compiler_builtins.json +++ b/share/compliance/compiler_builtins.json @@ -1,1865 +1,56 @@ { - "description":"Compiler builtins supported by Frama-C", - "source":"Mostly https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html, from pages with 'Builtins' in their title", + "description":"Compiler builtins supported by Frama-C (for GCC builtins, see gcc_builtins.json)", "notes": { - "compiler":"When present, indicates this builtin is only available in Frama-C machdeps with this compiler. Allowed values: gcc, msvc, !msvc (the latter meaning: 'available in machdeps with compilers other than MSVC').", + "compiler":"When present, indicates this builtin is only available in Frama-C machdeps with this compiler. Allowed values: msvc, !msvc (the latter meaning: 'available in machdeps with compilers other than MSVC').", "rettype":"Return type of the builtin. Whitespace is important: types are matched as exact strings, with a single space between components.", "args":"List of the types of the builtin arguments. Whitespace is important: types are matched as exact strings, with a single space between components.", - "types":"When present, a list indicating that this is a builtin template, to be instantiated for each type in the list. Instantiation is the replacement of each occurrence of 'type' in 'rettype' and 'args' with the elements of this list.", - "variadic":"Whether this builtin behaves as a variadic function." + "variadic":"When present, this builtin behaves as a variadic function." }, "data":{ - "__builtin__Exit": { - "compiler":"gcc", - "rettype":"void", - "args": ["int"], - "variadic":false - }, - "__builtin___fprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["void *","int","char const *"], - "variadic":true - }, - "__builtin___memcpy_chk": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","void const *","size_t","size_t"], - "variadic":false - }, - "__builtin___memmove_chk": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","void const *","size_t","size_t"], - "variadic":false - }, - "__builtin___mempcpy_chk": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","void const *","size_t","size_t"], - "variadic":false - }, - "__builtin___memset_chk": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","int","size_t","size_t"], - "variadic":false - }, - "__builtin___printf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["int","char const *"], - "variadic":true - }, - "__builtin___snprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","size_t","int","size_t","char const *"], - "variadic":true - }, - "__builtin___sprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","int","size_t","char const *"], - "variadic":true - }, - "__builtin___stpcpy_chk": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t"], - "variadic":false - }, - "__builtin___strcat_chk": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t"], - "variadic":false - }, - "__builtin___strcpy_chk": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t"], - "variadic":false - }, - "__builtin___strncat_chk": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t","size_t"], - "variadic":false - }, - "__builtin___strncpy_chk": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t","size_t"], - "variadic":false - }, - "__builtin___vfprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["void *","int","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin___vprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["int","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin___vsnprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","size_t","int","size_t","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin___vsprintf_chk": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","int","size_t","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_abs": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_acos": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_acosf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_acosh": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_acoshf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_acoshl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_acosl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_alloca": { - "compiler":"gcc", - "rettype":"void *", - "args": ["size_t"], - "variadic":false - }, "__builtin__annotation": { "compiler":"msvc", "rettype":"void", "args": [], "variadic":true }, - "__builtin_asin": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_asinf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_asinh": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_asinhf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_asinhl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_asinl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_atan": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_atan2": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_atan2f": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_atan2l": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_atanf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_atanh": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_atanhf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_atanhl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_atanl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_bswap16": { - "compiler":"gcc", - "rettype":"uint16_t", - "args": ["uint16_t"], - "variadic":false - }, - "__builtin_bswap32": { - "compiler":"gcc", - "rettype":"uint32_t", - "args": ["uint32_t"], - "variadic":false - }, - "__builtin_bswap64": { - "compiler":"gcc", - "rettype":"uint64_t", - "args": ["uint64_t"], - "variadic":false - }, - "__builtin_calloc": { - "compiler":"gcc", - "rettype":"void *", - "args": ["size_t","size_t"], - "variadic":false - }, - "__builtin_cbrt": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_cbrtf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_cbrtl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_ceil": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_ceilf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_ceill": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_constant_p": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_copysign": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_copysignf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_copysignl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_cos": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_cosf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_cosh": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_coshf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_coshl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_cosl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_erf": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_erfc": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_erfcf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_erfcl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_erff": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_erfl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_exit": { - "compiler":"gcc", - "rettype":"void", - "args": ["int"], - "variadic":false - }, - "__builtin_exp": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_exp2": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_exp2f": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_exp2l": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_expect": { - "compiler":"gcc", - "rettype":"long", - "args": ["long","long"], - "variadic":false - }, - "__builtin_expf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_expl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_expm1": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_expm1f": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_expm1l": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_fabs": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_fabsf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_fabsl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_fdim": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_fdimf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_fdiml": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_ffs": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_ffsl": { - "compiler":"gcc", - "rettype":"int", - "args": ["long"], - "variadic":false - }, - "__builtin_ffsll": { - "compiler":"gcc", - "rettype":"int", - "args": ["long long"], - "variadic":false - }, - "__builtin_floor": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_floorf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_floorl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_fma": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double","double"], - "variadic":false - }, - "__builtin_fmaf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float","float"], - "variadic":false - }, - "__builtin_fmal": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double","long double"], - "variadic":false - }, - "__builtin_fmax": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_fmaxf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_fmaxl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_fmin": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_fminf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_fminl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_fmod": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_fmodf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_fmodl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_fprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["void *","char const *"], - "variadic":true - }, - "__builtin_fputs": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","void *"], - "variadic":false - }, - "__builtin_frame_address": { - "compiler":"gcc", - "rettype":"void *", - "args": ["unsigned int"], - "variadic":false - }, - "__builtin_free": { - "compiler":"gcc", - "rettype":"void", - "args": ["void *"], - "variadic":false - }, - "__builtin_frexp": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","int *"], - "variadic":false - }, - "__builtin_frexpf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","int *"], - "variadic":false - }, - "__builtin_frexpl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","int *"], - "variadic":false - }, - "__builtin_fscanf": { - "compiler":"gcc", - "rettype":"int", - "args": ["void *","char const *"], - "variadic":true - }, - "__builtin_huge_val": { - "compiler":"gcc", - "rettype":"double", - "args": [], - "variadic":false - }, - "__builtin_huge_valf": { - "compiler":"gcc", - "rettype":"float", - "args": [], - "variadic":false - }, - "__builtin_huge_vall": { - "compiler":"gcc", - "rettype":"long double", - "args": [], - "variadic":false - }, - "__builtin_hypot": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_hypotf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_hypotl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_ia32_lfence": { - "compiler":"gcc", - "rettype":"void", - "args": [], - "variadic":false - }, - "__builtin_ia32_mfence": { - "compiler":"gcc", - "rettype":"void", - "args": [], - "variadic":false - }, - "__builtin_ia32_sfence": { - "compiler":"gcc", - "rettype":"void", - "args": [], - "variadic":false - }, - "__builtin_ilogb": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_ilogbf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_ilogbl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_inf": { - "compiler":"gcc", - "rettype":"double", - "args": [], - "variadic":false - }, - "__builtin_inff": { - "compiler":"gcc", - "rettype":"float", - "args": [], - "variadic":false - }, - "__builtin_infl": { - "compiler":"gcc", - "rettype":"long double", - "args": [], - "variadic":false - }, - "__builtin_isalnum": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isalpha": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isblank": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_iscntrl": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isdigit": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isgraph": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_islower": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isprint": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_ispunct": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isspace": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isupper": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_isxdigit": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_labs": { - "compiler":"gcc", - "rettype":"long", - "args": ["long"], - "variadic":false - }, - "__builtin_ldexp": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","int"], - "variadic":false - }, - "__builtin_ldexpf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","int"], - "variadic":false - }, - "__builtin_ldexpl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","int"], - "variadic":false - }, - "__builtin_lgamma": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_lgammaf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_lgammal": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_llabs": { - "compiler":"gcc", - "rettype":"long long", - "args": ["long long"], - "variadic":false - }, - "__builtin_llrint": { - "compiler":"gcc", - "rettype":"long long", - "args": ["double"], - "variadic":false - }, - "__builtin_llrintf": { - "compiler":"gcc", - "rettype":"long long", - "args": ["float"], - "variadic":false - }, - "__builtin_llrintl": { - "compiler":"gcc", - "rettype":"long long", - "args": ["long double"], - "variadic":false - }, - "__builtin_llround": { - "compiler":"gcc", - "rettype":"long long", - "args": ["double"], - "variadic":false - }, - "__builtin_llroundf": { - "compiler":"gcc", - "rettype":"long long", - "args": ["float"], - "variadic":false - }, - "__builtin_llroundl": { - "compiler":"gcc", - "rettype":"long long", - "args": ["long double"], - "variadic":false - }, - "__builtin_log": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_log10": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_log10f": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_log10l": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_log1p": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_log1pf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_log1pl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_log2": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_log2f": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_log2l": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_logb": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_logbf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_logbl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_logf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_logl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_lrint": { - "compiler":"gcc", - "rettype":"long", - "args": ["double"], - "variadic":false - }, - "__builtin_lrintf": { - "compiler":"gcc", - "rettype":"long", - "args": ["float"], - "variadic":false - }, - "__builtin_lrintl": { - "compiler":"gcc", - "rettype":"long", - "args": ["long double"], - "variadic":false - }, - "__builtin_lround": { - "compiler":"gcc", - "rettype":"long", - "args": ["double"], - "variadic":false - }, - "__builtin_lroundf": { - "compiler":"gcc", - "rettype":"long", - "args": ["float"], - "variadic":false - }, - "__builtin_lroundl": { - "compiler":"gcc", - "rettype":"long", - "args": ["long double"], - "variadic":false - }, - "__builtin_malloc": { - "compiler":"gcc", - "rettype":"void *", - "args": ["size_t"], - "variadic":false - }, - "__builtin_memchr": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void const *","int","size_t"], - "variadic":false - }, - "__builtin_memcmp": { - "compiler":"gcc", - "rettype":"int", - "args": ["void const *","void const *","size_t"], - "variadic":false - }, - "__builtin_memcpy": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","void const *","size_t"], - "variadic":false - }, - "__builtin_mempcpy": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","void const *","size_t"], - "variadic":false - }, - "__builtin_memset": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","int","size_t"], - "variadic":false - }, - "__builtin_modf": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double *"], - "variadic":false - }, - "__builtin_modff": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float *"], - "variadic":false - }, - "__builtin_modfl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double *"], - "variadic":false - }, - "__builtin_nan": { - "compiler":"gcc", - "rettype":"double", - "args": ["char const *"], - "variadic":false - }, - "__builtin_nanf": { - "compiler":"gcc", - "rettype":"float", - "args": ["char const *"], - "variadic":false - }, - "__builtin_nanl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["char const *"], - "variadic":false - }, - "__builtin_nans": { - "compiler":"gcc", - "rettype":"double", - "args": ["char const *"], - "variadic":false - }, - "__builtin_nansf": { - "compiler":"gcc", - "rettype":"float", - "args": ["char const *"], - "variadic":false - }, - "__builtin_nansl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["char const *"], - "variadic":false - }, - "__builtin_nearbyint": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_nearbyintf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_nearbyintl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_nextafter": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_nextafterf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_nextafterl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_nexttoward": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","long double"], - "variadic":false - }, - "__builtin_nexttowardf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","long double"], - "variadic":false - }, - "__builtin_nexttowardl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_object_size": { - "compiler":"gcc", - "rettype":"size_t", - "args": ["void *","int"], - "variadic":false + "__builtin_next_arg": { + "compiler":"!msvc", + "rettype":"__builtin_va_list", + "args": [] }, "__builtin_offsetof": { "rettype":"size_t", - "args": ["size_t"], - "variadic":false - }, - "__builtin_parity": { - "compiler":"gcc", - "rettype":"int", - "args": ["unsigned int"], - "variadic":false - }, - "__builtin_parityl": { - "compiler":"gcc", - "rettype":"int", - "args": ["unsigned long"], - "variadic":false - }, - "__builtin_parityll": { - "compiler":"gcc", - "rettype":"int", - "args": ["unsigned long long"], - "variadic":false - }, - "__builtin_pow": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_powf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_powi": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","int"], - "variadic":false - }, - "__builtin_powif": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","int"], - "variadic":false - }, - "__builtin_powil": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","int"], - "variadic":false - }, - "__builtin_powl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_prefetch": { - "compiler":"gcc", - "rettype":"void", - "args": ["void const *"], - "variadic":true - }, - "__builtin_printf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *"], - "variadic":true - }, - "__builtin_putchar": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_puts": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *"], - "variadic":false - }, - "__builtin_realloc": { - "compiler":"gcc", - "rettype":"void *", - "args": ["void *","size_t"], - "variadic":false - }, - "__builtin_remainder": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double"], - "variadic":false - }, - "__builtin_remainderf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float"], - "variadic":false - }, - "__builtin_remainderl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double"], - "variadic":false - }, - "__builtin_remquo": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","double","int *"], - "variadic":false - }, - "__builtin_remquof": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","float","int *"], - "variadic":false - }, - "__builtin_remquol": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long double","int *"], - "variadic":false - }, - "__builtin_return": { - "compiler":"gcc", - "rettype":"void", - "args": ["void const *"], - "variadic":false - }, - "__builtin_return_address": { - "compiler":"gcc", - "rettype":"void *", - "args": ["unsigned int"], - "variadic":false - }, - "__builtin_rint": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_rintf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_rintl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_round": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_roundf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_roundl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_scalbln": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","long"], - "variadic":false - }, - "__builtin_scalblnf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","long"], - "variadic":false - }, - "__builtin_scalblnl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","long"], - "variadic":false - }, - "__builtin_scalbn": { - "compiler":"gcc", - "rettype":"double", - "args": ["double","int"], - "variadic":false - }, - "__builtin_scalbnf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float","int"], - "variadic":false - }, - "__builtin_scalbnl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double","int"], - "variadic":false - }, - "__builtin_scanf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *"], - "variadic":true - }, - "__builtin_sin": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_sinf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_sinh": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_sinhf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_sinhl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_sinl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_snprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","size_t","char const *"], - "variadic":true - }, - "__builtin_sprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","char const *"], - "variadic":true - }, - "__builtin_sqrt": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_sqrtf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_sqrtl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_sscanf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","char const *"], - "variadic":true + "args": ["size_t"] }, "__builtin_stdarg_start": { "compiler":"!msvc", "rettype":"void", - "args": ["__builtin_va_list"], - "variadic":false - }, - "__builtin_stpcpy": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *"], - "variadic":false - }, - "__builtin_strcat": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *"], - "variadic":false - }, - "__builtin_strchr": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","int"], - "variadic":false - }, - "__builtin_strcmp": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","char const *"], - "variadic":false - }, - "__builtin_strcpy": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *"], - "variadic":false - }, - "__builtin_strcspn": { - "compiler":"gcc", - "rettype":"size_t", - "args": ["char const *","char const *"], - "variadic":false - }, - "__builtin_strlen": { - "compiler":"gcc", - "rettype":"size_t", - "args": ["char const *"], - "variadic":false - }, - "__builtin_strncat": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t"], - "variadic":false - }, - "__builtin_strncmp": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","char const *","size_t"], - "variadic":false - }, - "__builtin_strncpy": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char *","char const *","size_t"], - "variadic":false - }, - "__builtin_strpbrk": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char const *","char const *"], - "variadic":false - }, - "__builtin_strrchr": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char const *","int"], - "variadic":false - }, - "__builtin_strspn": { - "compiler":"gcc", - "rettype":"size_t", - "args": ["char const *","char const *"], - "variadic":false - }, - "__builtin_strstr": { - "compiler":"gcc", - "rettype":"char *", - "args": ["char const *","char const *"], - "variadic":false - }, - "__builtin_tan": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_tanf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_tanh": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_tanhf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_tanhl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_tanl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_tgamma": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_tgammaf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_tgammal": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_tolower": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_toupper": { - "compiler":"gcc", - "rettype":"int", - "args": ["int"], - "variadic":false - }, - "__builtin_trunc": { - "compiler":"gcc", - "rettype":"double", - "args": ["double"], - "variadic":false - }, - "__builtin_truncf": { - "compiler":"gcc", - "rettype":"float", - "args": ["float"], - "variadic":false - }, - "__builtin_truncl": { - "compiler":"gcc", - "rettype":"long double", - "args": ["long double"], - "variadic":false - }, - "__builtin_types_compatible_p": { - "compiler":"gcc", - "rettype":"int", - "args": ["size_t","size_t"], - "variadic":false - }, - "__builtin_unreachable": { - "compiler":"gcc", - "rettype":"void", - "args": [], - "variadic":false + "args": ["__builtin_va_list"] }, "__builtin_va_arg": { "compiler":"!msvc", "rettype":"void", - "args": ["__builtin_va_list","size_t","void *"], - "variadic":false + "args": ["__builtin_va_list","size_t","void *"] }, "__builtin_va_copy": { "compiler":"!msvc", "rettype":"void", - "args": ["__builtin_va_list","__builtin_va_list"], - "variadic":false + "args": ["__builtin_va_list","__builtin_va_list"] }, "__builtin_va_end": { "compiler":"!msvc", "rettype":"void", - "args": ["__builtin_va_list"], - "variadic":false - }, - "__builtin_next_arg": { - "compiler":"!msvc", - "rettype":"__builtin_va_list", - "args": [], - "variadic":false + "args": ["__builtin_va_list"] }, "__builtin_va_start": { "compiler":"!msvc", "rettype":"void", - "args": ["__builtin_va_list"], - "variadic":false + "args": ["__builtin_va_list"] }, "__builtin_varargs_start": { "compiler":"!msvc", "rettype":"void", - "args": ["__builtin_va_list"], - "variadic":false - }, - "__builtin_vfprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["void *","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_vfscanf": { - "compiler":"gcc", - "rettype":"int", - "args": ["void *","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_vprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_vscanf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_vsnprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","size_t","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_vsprintf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char *","char const *","__builtin_va_list"], - "variadic":false - }, - "__builtin_vsscanf": { - "compiler":"gcc", - "rettype":"int", - "args": ["char const *","char const *","__builtin_va_list"], - "variadic":false - }, - - "__sync_add_and_fetch": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_and_and_fetch": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_bool_compare_and_swap": { - "compiler":"gcc", - "rettype":"int", - "args": ["type volatile *", "type", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_fetch_and_add": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_fetch_and_and": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_fetch_and_nand": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_fetch_and_or": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_fetch_and_sub": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_fetch_and_xor": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_lock_release": { - "compiler":"gcc", - "rettype":"void", - "args": ["type volatile *"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_lock_test_and_set": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_nand_and_fetch": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_or_and_fetch": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_sub_and_fetch": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_val_compare_and_swap": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *","type","type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true - }, - "__sync_xor_and_fetch": { - "compiler":"gcc", - "rettype":"type", - "args": ["type volatile *", "type"], - "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], - "variadic":true + "args": ["__builtin_va_list"] } } } diff --git a/share/compliance/gcc_builtins.json b/share/compliance/gcc_builtins.json new file mode 100644 index 00000000000..d5cf906f7ff --- /dev/null +++ b/share/compliance/gcc_builtins.json @@ -0,0 +1,1252 @@ +{ + "description":"GCC builtins supported by Frama-C", + "source":"Mostly https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html, from pages with 'Builtins' in their title", + "notes": { + "rettype":"Return type of the builtin. Whitespace is important: types are matched as exact strings, with a single space between components.", + "args":"List of the types of the builtin arguments. Whitespace is important: types are matched as exact strings, with a single space between components.", + "types":"When present, a list indicating that this is a builtin template, to be instantiated for each type in the list. Instantiation is the replacement of each occurrence of 'type' in 'rettype' and 'args' with the elements of this list.", + "variadic":"When present, this builtin behaves as a variadic function." + }, + "data":{ + "__builtin__Exit": { + "rettype":"void", + "args": ["int"] + }, + "__builtin___fprintf_chk": { + "rettype":"int", + "args": ["void *","int","char const *"], + "variadic":true + }, + "__builtin___memcpy_chk": { + "rettype":"void *", + "args": ["void *","void const *","size_t","size_t"] + }, + "__builtin___memmove_chk": { + "rettype":"void *", + "args": ["void *","void const *","size_t","size_t"] + }, + "__builtin___mempcpy_chk": { + "rettype":"void *", + "args": ["void *","void const *","size_t","size_t"] + }, + "__builtin___memset_chk": { + "rettype":"void *", + "args": ["void *","int","size_t","size_t"] + }, + "__builtin___printf_chk": { + "rettype":"int", + "args": ["int","char const *"], + "variadic":true + }, + "__builtin___snprintf_chk": { + "rettype":"int", + "args": ["char *","size_t","int","size_t","char const *"], + "variadic":true + }, + "__builtin___sprintf_chk": { + "rettype":"int", + "args": ["char *","int","size_t","char const *"], + "variadic":true + }, + "__builtin___stpcpy_chk": { + "rettype":"char *", + "args": ["char *","char const *","size_t"] + }, + "__builtin___strcat_chk": { + "rettype":"char *", + "args": ["char *","char const *","size_t"] + }, + "__builtin___strcpy_chk": { + "rettype":"char *", + "args": ["char *","char const *","size_t"] + }, + "__builtin___strncat_chk": { + "rettype":"char *", + "args": ["char *","char const *","size_t","size_t"] + }, + "__builtin___strncpy_chk": { + "rettype":"char *", + "args": ["char *","char const *","size_t","size_t"] + }, + "__builtin___vfprintf_chk": { + "rettype":"int", + "args": ["void *","int","char const *","__builtin_va_list"] + }, + "__builtin___vprintf_chk": { + "rettype":"int", + "args": ["int","char const *","__builtin_va_list"] + }, + "__builtin___vsnprintf_chk": { + "rettype":"int", + "args": ["char *","size_t","int","size_t","char const *","__builtin_va_list"] + }, + "__builtin___vsprintf_chk": { + "rettype":"int", + "args": ["char *","int","size_t","char const *","__builtin_va_list"] + }, + "__builtin_abs": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_acos": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_acosf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_acosh": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_acoshf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_acoshl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_acosl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_alloca": { + "rettype":"void *", + "args": ["size_t"] + }, + "__builtin_asin": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_asinf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_asinh": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_asinhf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_asinhl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_asinl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_atan": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_atan2": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_atan2f": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_atan2l": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_atanf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_atanh": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_atanhf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_atanhl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_atanl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_bswap16": { + "rettype":"uint16_t", + "args": ["uint16_t"] + }, + "__builtin_bswap32": { + "rettype":"uint32_t", + "args": ["uint32_t"] + }, + "__builtin_bswap64": { + "rettype":"uint64_t", + "args": ["uint64_t"] + }, + "__builtin_calloc": { + "rettype":"void *", + "args": ["size_t","size_t"] + }, + "__builtin_cbrt": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_cbrtf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_cbrtl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_ceil": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_ceilf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_ceill": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_constant_p": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_copysign": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_copysignf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_copysignl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_cos": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_cosf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_cosh": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_coshf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_coshl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_cosl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_erf": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_erfc": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_erfcf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_erfcl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_erff": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_erfl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_exit": { + "rettype":"void", + "args": ["int"] + }, + "__builtin_exp": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_exp2": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_exp2f": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_exp2l": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_expect": { + "rettype":"long", + "args": ["long","long"] + }, + "__builtin_expf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_expl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_expm1": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_expm1f": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_expm1l": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_fabs": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_fabsf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_fabsl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_fdim": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_fdimf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_fdiml": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_ffs": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_ffsl": { + "rettype":"int", + "args": ["long"] + }, + "__builtin_ffsll": { + "rettype":"int", + "args": ["long long"] + }, + "__builtin_floor": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_floorf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_floorl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_fma": { + "rettype":"double", + "args": ["double","double","double"] + }, + "__builtin_fmaf": { + "rettype":"float", + "args": ["float","float","float"] + }, + "__builtin_fmal": { + "rettype":"long double", + "args": ["long double","long double","long double"] + }, + "__builtin_fmax": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_fmaxf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_fmaxl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_fmin": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_fminf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_fminl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_fmod": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_fmodf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_fmodl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_fprintf": { + "rettype":"int", + "args": ["void *","char const *"], + "variadic":true + }, + "__builtin_fputs": { + "rettype":"int", + "args": ["char const *","void *"] + }, + "__builtin_frame_address": { + "rettype":"void *", + "args": ["unsigned int"] + }, + "__builtin_free": { + "rettype":"void", + "args": ["void *"] + }, + "__builtin_frexp": { + "rettype":"double", + "args": ["double","int *"] + }, + "__builtin_frexpf": { + "rettype":"float", + "args": ["float","int *"] + }, + "__builtin_frexpl": { + "rettype":"long double", + "args": ["long double","int *"] + }, + "__builtin_fscanf": { + "rettype":"int", + "args": ["void *","char const *"], + "variadic":true + }, + "__builtin_huge_val": { + "rettype":"double", + "args": [] + }, + "__builtin_huge_valf": { + "rettype":"float", + "args": [] + }, + "__builtin_huge_vall": { + "rettype":"long double", + "args": [] + }, + "__builtin_hypot": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_hypotf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_hypotl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_ia32_lfence": { + "rettype":"void", + "args": [] + }, + "__builtin_ia32_mfence": { + "rettype":"void", + "args": [] + }, + "__builtin_ia32_sfence": { + "rettype":"void", + "args": [] + }, + "__builtin_ilogb": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_ilogbf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_ilogbl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_inf": { + "rettype":"double", + "args": [] + }, + "__builtin_inff": { + "rettype":"float", + "args": [] + }, + "__builtin_infl": { + "rettype":"long double", + "args": [] + }, + "__builtin_isalnum": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isalpha": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isblank": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_iscntrl": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isdigit": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isgraph": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_islower": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isprint": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_ispunct": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isspace": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isupper": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_isxdigit": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_labs": { + "rettype":"long", + "args": ["long"] + }, + "__builtin_ldexp": { + "rettype":"double", + "args": ["double","int"] + }, + "__builtin_ldexpf": { + "rettype":"float", + "args": ["float","int"] + }, + "__builtin_ldexpl": { + "rettype":"long double", + "args": ["long double","int"] + }, + "__builtin_lgamma": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_lgammaf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_lgammal": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_llabs": { + "rettype":"long long", + "args": ["long long"] + }, + "__builtin_llrint": { + "rettype":"long long", + "args": ["double"] + }, + "__builtin_llrintf": { + "rettype":"long long", + "args": ["float"] + }, + "__builtin_llrintl": { + "rettype":"long long", + "args": ["long double"] + }, + "__builtin_llround": { + "rettype":"long long", + "args": ["double"] + }, + "__builtin_llroundf": { + "rettype":"long long", + "args": ["float"] + }, + "__builtin_llroundl": { + "rettype":"long long", + "args": ["long double"] + }, + "__builtin_log": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_log10": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_log10f": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_log10l": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_log1p": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_log1pf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_log1pl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_log2": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_log2f": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_log2l": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_logb": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_logbf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_logbl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_logf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_logl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_lrint": { + "rettype":"long", + "args": ["double"] + }, + "__builtin_lrintf": { + "rettype":"long", + "args": ["float"] + }, + "__builtin_lrintl": { + "rettype":"long", + "args": ["long double"] + }, + "__builtin_lround": { + "rettype":"long", + "args": ["double"] + }, + "__builtin_lroundf": { + "rettype":"long", + "args": ["float"] + }, + "__builtin_lroundl": { + "rettype":"long", + "args": ["long double"] + }, + "__builtin_malloc": { + "rettype":"void *", + "args": ["size_t"] + }, + "__builtin_memchr": { + "rettype":"void *", + "args": ["void const *","int","size_t"] + }, + "__builtin_memcmp": { + "rettype":"int", + "args": ["void const *","void const *","size_t"] + }, + "__builtin_memcpy": { + "rettype":"void *", + "args": ["void *","void const *","size_t"] + }, + "__builtin_mempcpy": { + "rettype":"void *", + "args": ["void *","void const *","size_t"] + }, + "__builtin_memset": { + "rettype":"void *", + "args": ["void *","int","size_t"] + }, + "__builtin_modf": { + "rettype":"double", + "args": ["double","double *"] + }, + "__builtin_modff": { + "rettype":"float", + "args": ["float","float *"] + }, + "__builtin_modfl": { + "rettype":"long double", + "args": ["long double","long double *"] + }, + "__builtin_nan": { + "rettype":"double", + "args": ["char const *"] + }, + "__builtin_nanf": { + "rettype":"float", + "args": ["char const *"] + }, + "__builtin_nanl": { + "rettype":"long double", + "args": ["char const *"] + }, + "__builtin_nans": { + "rettype":"double", + "args": ["char const *"] + }, + "__builtin_nansf": { + "rettype":"float", + "args": ["char const *"] + }, + "__builtin_nansl": { + "rettype":"long double", + "args": ["char const *"] + }, + "__builtin_nearbyint": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_nearbyintf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_nearbyintl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_nextafter": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_nextafterf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_nextafterl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_nexttoward": { + "rettype":"double", + "args": ["double","long double"] + }, + "__builtin_nexttowardf": { + "rettype":"float", + "args": ["float","long double"] + }, + "__builtin_nexttowardl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_object_size": { + "rettype":"size_t", + "args": ["void *","int"] + }, + "__builtin_offsetof": { + "rettype":"size_t", + "args": ["size_t"] + }, + "__builtin_parity": { + "rettype":"int", + "args": ["unsigned int"] + }, + "__builtin_parityl": { + "rettype":"int", + "args": ["unsigned long"] + }, + "__builtin_parityll": { + "rettype":"int", + "args": ["unsigned long long"] + }, + "__builtin_pow": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_powf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_powi": { + "rettype":"double", + "args": ["double","int"] + }, + "__builtin_powif": { + "rettype":"float", + "args": ["float","int"] + }, + "__builtin_powil": { + "rettype":"long double", + "args": ["long double","int"] + }, + "__builtin_powl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_prefetch": { + "rettype":"void", + "args": ["void const *"], + "variadic":true + }, + "__builtin_printf": { + "rettype":"int", + "args": ["char const *"], + "variadic":true + }, + "__builtin_putchar": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_puts": { + "rettype":"int", + "args": ["char const *"] + }, + "__builtin_realloc": { + "rettype":"void *", + "args": ["void *","size_t"] + }, + "__builtin_remainder": { + "rettype":"double", + "args": ["double","double"] + }, + "__builtin_remainderf": { + "rettype":"float", + "args": ["float","float"] + }, + "__builtin_remainderl": { + "rettype":"long double", + "args": ["long double","long double"] + }, + "__builtin_remquo": { + "rettype":"double", + "args": ["double","double","int *"] + }, + "__builtin_remquof": { + "rettype":"float", + "args": ["float","float","int *"] + }, + "__builtin_remquol": { + "rettype":"long double", + "args": ["long double","long double","int *"] + }, + "__builtin_return": { + "rettype":"void", + "args": ["void const *"] + }, + "__builtin_return_address": { + "rettype":"void *", + "args": ["unsigned int"] + }, + "__builtin_rint": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_rintf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_rintl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_round": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_roundf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_roundl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_scalbln": { + "rettype":"double", + "args": ["double","long"] + }, + "__builtin_scalblnf": { + "rettype":"float", + "args": ["float","long"] + }, + "__builtin_scalblnl": { + "rettype":"long double", + "args": ["long double","long"] + }, + "__builtin_scalbn": { + "rettype":"double", + "args": ["double","int"] + }, + "__builtin_scalbnf": { + "rettype":"float", + "args": ["float","int"] + }, + "__builtin_scalbnl": { + "rettype":"long double", + "args": ["long double","int"] + }, + "__builtin_scanf": { + "rettype":"int", + "args": ["char const *"], + "variadic":true + }, + "__builtin_sin": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_sinf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_sinh": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_sinhf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_sinhl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_sinl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_snprintf": { + "rettype":"int", + "args": ["char *","size_t","char const *"], + "variadic":true + }, + "__builtin_sprintf": { + "rettype":"int", + "args": ["char *","char const *"], + "variadic":true + }, + "__builtin_sqrt": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_sqrtf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_sqrtl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_sscanf": { + "rettype":"int", + "args": ["char const *","char const *"], + "variadic":true + }, + "__builtin_stdarg_start": { + "rettype":"void", + "args": ["__builtin_va_list"] + }, + "__builtin_stpcpy": { + "rettype":"char *", + "args": ["char *","char const *"] + }, + "__builtin_strcat": { + "rettype":"char *", + "args": ["char *","char const *"] + }, + "__builtin_strchr": { + "rettype":"char *", + "args": ["char *","int"] + }, + "__builtin_strcmp": { + "rettype":"int", + "args": ["char const *","char const *"] + }, + "__builtin_strcpy": { + "rettype":"char *", + "args": ["char *","char const *"] + }, + "__builtin_strcspn": { + "rettype":"size_t", + "args": ["char const *","char const *"] + }, + "__builtin_strlen": { + "rettype":"size_t", + "args": ["char const *"] + }, + "__builtin_strncat": { + "rettype":"char *", + "args": ["char *","char const *","size_t"] + }, + "__builtin_strncmp": { + "rettype":"int", + "args": ["char const *","char const *","size_t"] + }, + "__builtin_strncpy": { + "rettype":"char *", + "args": ["char *","char const *","size_t"] + }, + "__builtin_strpbrk": { + "rettype":"char *", + "args": ["char const *","char const *"] + }, + "__builtin_strrchr": { + "rettype":"char *", + "args": ["char const *","int"] + }, + "__builtin_strspn": { + "rettype":"size_t", + "args": ["char const *","char const *"] + }, + "__builtin_strstr": { + "rettype":"char *", + "args": ["char const *","char const *"] + }, + "__builtin_tan": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_tanf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_tanh": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_tanhf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_tanhl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_tanl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_tgamma": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_tgammaf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_tgammal": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_tolower": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_toupper": { + "rettype":"int", + "args": ["int"] + }, + "__builtin_trunc": { + "rettype":"double", + "args": ["double"] + }, + "__builtin_truncf": { + "rettype":"float", + "args": ["float"] + }, + "__builtin_truncl": { + "rettype":"long double", + "args": ["long double"] + }, + "__builtin_types_compatible_p": { + "rettype":"int", + "args": ["size_t","size_t"] + }, + "__builtin_unreachable": { + "rettype":"void", + "args": [] + }, + "__builtin_vfprintf": { + "rettype":"int", + "args": ["void *","char const *","__builtin_va_list"] + }, + "__builtin_vfscanf": { + "rettype":"int", + "args": ["void *","char const *","__builtin_va_list"] + }, + "__builtin_vprintf": { + "rettype":"int", + "args": ["char const *","__builtin_va_list"] + }, + "__builtin_vscanf": { + "rettype":"int", + "args": ["char const *","__builtin_va_list"] + }, + "__builtin_vsnprintf": { + "rettype":"int", + "args": ["char *","size_t","char const *","__builtin_va_list"] + }, + "__builtin_vsprintf": { + "rettype":"int", + "args": ["char *","char const *","__builtin_va_list"] + }, + "__builtin_vsscanf": { + "rettype":"int", + "args": ["char const *","char const *","__builtin_va_list"] + }, + "__sync_add_and_fetch": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_and_and_fetch": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_bool_compare_and_swap": { + "rettype":"int", + "args": ["T volatile *", "T", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_fetch_and_add": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_fetch_and_and": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_fetch_and_nand": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_fetch_and_or": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_fetch_and_sub": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_fetch_and_xor": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_lock_release": { + "rettype":"void", + "args": ["T volatile *"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_lock_test_and_set": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_nand_and_fetch": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_or_and_fetch": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_sub_and_fetch": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_val_compare_and_swap": { + "rettype":"T", + "args": ["T volatile *","T","T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + }, + "__sync_xor_and_fetch": { + "rettype":"T", + "args": ["T volatile *", "T"], + "types":["int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t"], + "variadic":true + } + } +} diff --git a/src/kernel_internals/runtime/special_hooks.ml b/src/kernel_internals/runtime/special_hooks.ml index 195f318ade3..95cd3898f7e 100644 --- a/src/kernel_internals/runtime/special_hooks.ml +++ b/src/kernel_internals/runtime/special_hooks.ml @@ -246,10 +246,12 @@ let () = Cmdline.run_after_exiting_stage run_list_all_plugin_options (* Hooks independent from cmdline ordering *) (**************************************************************************) - - let warn_if_another_compiler_builtin name = try + (* Before warning, we must make sure the builtins from other compilers + are loaded. *) + if not (Cil_builtins.Gcc_builtin_templates_loaded.get ()) then + Cil_builtins.init_gcc_builtin_templates (); let bt = Cil_builtins.Builtin_templates.find name in let compiler = Option.get bt.compiler in Kernel.warning ~wkey:Kernel.wkey_implicit_function_declaration diff --git a/src/kernel_services/ast_queries/cil_builtins.ml b/src/kernel_services/ast_queries/cil_builtins.ml index a3c11a5f99e..4d2aaaecf5e 100644 --- a/src/kernel_services/ast_queries/cil_builtins.ml +++ b/src/kernel_services/ast_queries/cil_builtins.ml @@ -182,6 +182,15 @@ module Builtin_templates = let size = 200 end) +module Gcc_builtin_templates_loaded = + State_builder.Ref + (Datatype.Bool) + (struct + let name = "Cil_builtins.Gcc_builtin_templates_loaded" + let dependencies = [ Builtin_templates.self ] + let default () = false + end) + (* An actual instance of a builtin_template, with actual types. *) type builtin = { name: string; @@ -202,20 +211,20 @@ struct let json = Json.from_file fp in member "data" json - let init_builtin_templates () = - let fp = - Datatype.Filepath.concat ~existence:Filepath.Must_exist - Fc_config.datadir "compliance/compiler_builtins.json" - in + let init_builtin_templates ?default_compiler fp = let json = parse fp in List.iter (fun (name, entry) -> let compiler = - entry |> member "compiler" |> to_string_option |> - Option.map to_compiler + if default_compiler <> None then default_compiler + else + entry |> member "compiler" |> to_string_option |> + Option.map to_compiler in let rettype = entry |> member "rettype" |> to_string in let args = entry |> member "args" |> to_list |> List.map to_string in - let variadic = entry |> member "variadic" |> to_bool in + let variadic = + entry |> member "variadic" |> to_bool_option |> Option.is_some + in let types = match entry |> member "types" with | `Null -> None @@ -310,9 +319,9 @@ let build_type_table () : (string, typ option) Hashtbl.t = let parse_type ?(template="") type_table s = try - if Extlib.string_prefix "type" s then - (* replace 'type' (always at the beginning) with the template *) - let typ = template ^ (String.sub s 4 (String.length s - 4)) in + if String.get s 0 == 'T' then + (* replace 'T' (always at the beginning) with the template *) + let typ = template ^ (String.sub s 1 (String.length s - 1)) in Hashtbl.find type_table typ else Hashtbl.find type_table s @@ -405,8 +414,26 @@ let instantiate_available_templates type_table name (entry : builtin_template) = | None -> make_builtin_as_list name -let init_builtins () = - Json.init_builtin_templates (); +let init_gcc_builtin_templates () = + let fp = + Datatype.Filepath.concat ~existence:Filepath.Must_exist + Fc_config.datadir "compliance/gcc_builtins.json" + in + Json.init_builtin_templates ~default_compiler:GCC fp; + Gcc_builtin_templates_loaded.set true + +let init_other_builtin_templates () = + let fp = + Datatype.Filepath.concat ~existence:Filepath.Must_exist + Fc_config.datadir "compliance/compiler_builtins.json" + in + Json.init_builtin_templates fp + +let init_builtins_from_json () = + (* For performance reasons, we avoid loading GCC builtins unless we are + using a GCC machdep *) + if Cil.gccMode () then init_gcc_builtin_templates (); + init_other_builtin_templates (); let type_table = build_type_table () in Builtin_templates.iter (fun name entry -> (* In the JSON file, each entry is possibly a template for @@ -420,7 +447,7 @@ let init_builtins () = Kernel.fatal ~current:true "You must call initCIL before init_builtins" ; if Builtin_functions.length () <> 0 then Kernel.fatal ~current:true "Cil builtins already initialized." ; - init_builtins (); + init_builtins_from_json (); Queue.iter (fun f -> register_custom_builtin (f())) custom_builtins (** This is used as the location of the prototypes of builtin functions. *) diff --git a/src/kernel_services/ast_queries/cil_builtins.mli b/src/kernel_services/ast_queries/cil_builtins.mli index 5ec4bf598d2..ebbebbbde4d 100644 --- a/src/kernel_services/ast_queries/cil_builtins.mli +++ b/src/kernel_services/ast_queries/cil_builtins.mli @@ -112,6 +112,10 @@ module Builtin_templates : State_builder.Hashtbl with type key = string and type data = builtin_template +module Gcc_builtin_templates_loaded : State_builder.Ref with type data = bool + +val init_gcc_builtin_templates : unit -> unit + (** Register a new builtin. The function will be called after setting the machdep and initializing machine-dependent builtins. Hence, types such {!Cil.uint16_t} might be used if needed. diff --git a/tests/compliance/check-json.i b/tests/compliance/check-json.i index 80c4d1a9d80..e539fed3e61 100644 --- a/tests/compliance/check-json.i +++ b/tests/compliance/check-json.i @@ -6,5 +6,6 @@ EXECNOW: LOG json_@PTEST_NAME@_3.txt python3 -m json.tool < @SHARE@/nonstandard_identifiers.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_3.txt 2> @DEV_NULL@ EXECNOW: LOG json_@PTEST_NAME@_4.txt python3 -m json.tool < @SHARE@/posix_identifiers.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_4.txt 2> @DEV_NULL@ EXECNOW: LOG json_@PTEST_NAME@_5.txt python3 -m json.tool < @SHARE@/compiler_builtins.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_5.txt 2> @DEV_NULL@ - EXECNOW: LOG json_@PTEST_NAME@_6.txt python3 @PTEST_DIR@/sanity-checks.py @SHARE@ > @PTEST_RESULT@/json_@PTEST_NAME@_6.txt 2> @DEV_NULL@ + EXECNOW: LOG json_@PTEST_NAME@_6.txt python3 -m json.tool < @SHARE@/gcc_builtins.json | head -n 2 > @PTEST_RESULT@/json_@PTEST_NAME@_6.txt 2> @DEV_NULL@ + EXECNOW: LOG json_@PTEST_NAME@_7.txt python3 @PTEST_DIR@/sanity-checks.py @SHARE@ > @PTEST_RESULT@/json_@PTEST_NAME@_7.txt 2> @DEV_NULL@ */ diff --git a/tests/compliance/oracle/json_check-json_5.txt b/tests/compliance/oracle/json_check-json_5.txt index 431457d543b..8dc6444a05e 100644 --- a/tests/compliance/oracle/json_check-json_5.txt +++ b/tests/compliance/oracle/json_check-json_5.txt @@ -1,2 +1,2 @@ { - "description": "Compiler builtins supported by Frama-C", + "description": "Compiler builtins supported by Frama-C (for GCC builtins, see gcc_builtins.json)", diff --git a/tests/compliance/oracle/json_check-json_6.txt b/tests/compliance/oracle/json_check-json_6.txt index 295b7a131d2..ece8bd177c4 100644 --- a/tests/compliance/oracle/json_check-json_6.txt +++ b/tests/compliance/oracle/json_check-json_6.txt @@ -1,2 +1,2 @@ -posix_identifiers.json checked. -c11_functions.json checked. +{ + "description": "GCC builtins supported by Frama-C", diff --git a/tests/compliance/oracle/json_check-json_7.txt b/tests/compliance/oracle/json_check-json_7.txt new file mode 100644 index 00000000000..295b7a131d2 --- /dev/null +++ b/tests/compliance/oracle/json_check-json_7.txt @@ -0,0 +1,2 @@ +posix_identifiers.json checked. +c11_functions.json checked. -- GitLab