diff --git a/llvm/include/llvm/Analysis/CMakeLists.txt b/llvm/include/llvm/Analysis/CMakeLists.txt index 036f7ff00ce86..b2655327be547 100644 --- a/llvm/include/llvm/Analysis/CMakeLists.txt +++ b/llvm/include/llvm/Analysis/CMakeLists.txt @@ -1,3 +1,3 @@ -set(LLVM_TARGET_DEFINITIONS TargetLibraryInfo.td) +set(LLVM_TARGET_DEFINITIONS ../IR/RuntimeLibcalls.td) tablegen(LLVM TargetLibraryInfo.inc -gen-target-library-info) add_public_tablegen_target(analysis_gen) diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h index 629b126db17c2..0d862f85e43d7 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h @@ -125,6 +125,9 @@ class TargetLibraryInfoImpl { LLVM_ABI TargetLibraryInfoImpl &operator=(const TargetLibraryInfoImpl &TLI); LLVM_ABI TargetLibraryInfoImpl &operator=(TargetLibraryInfoImpl &&TLI); + /// Generated by tablegen. + void setTargetLibraryLibcallSets(const Triple &TT); + /// Searches for a particular function name. /// /// If it is one of the known library functions, return true and set F to the @@ -427,10 +430,10 @@ class TargetLibraryInfo { /// Return the canonical name for a LibFunc. This should not be used for /// semantic purposes, use getName instead. - static StringRef getStandardName(LibFunc F) { - return StringRef(TargetLibraryInfoImpl::StandardNamesStrTable.getCString( - TargetLibraryInfoImpl::StandardNamesOffsets[F]), - TargetLibraryInfoImpl::StandardNamesSizeTable[F]); + StringRef getStandardName(LibFunc F) const { + return StringRef(Impl->StandardNamesStrTable.getCString( + Impl->StandardNamesOffsets[F]), + Impl->StandardNamesSizeTable[F]); } StringRef getName(LibFunc F) const { diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.td b/llvm/include/llvm/Analysis/TargetLibraryInfo.td deleted file mode 100644 index 41b2ee9a5597d..0000000000000 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.td +++ /dev/null @@ -1,1648 +0,0 @@ -//===-- TargetLibraryInfo.td - File that describes library functions ------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -include "llvm/IR/RuntimeLibcalls.td" - -/// void *operator new(unsigned int); -def TLI_msvc_new_int : TargetLibCall<__2_YAPAXI_Z>; - -/// void *operator new(unsigned int, const std::nothrow_t&); -def TLI_msvc_new_int_nothrow : TargetLibCall<__2_YAPAXIABUnothrow_t_std___Z>; - -/// void *operator new(unsigned long long); -def TLI_msvc_new_longlong : TargetLibCall<__2_YAPEAX_K_Z>; - -/// void *operator new(unsigned long long, const std::nothrow_t&); -def TLI_msvc_new_longlong_nothrow - : TargetLibCall<__2_YAPEAX_KAEBUnothrow_t_std___Z>; - -/// void operator delete(void*); -def TLI_msvc_delete_ptr32 : TargetLibCall<__3_YAXPAX_Z>; - -/// void operator delete(void*, const std::nothrow_t&); -def TLI_msvc_delete_ptr32_nothrow - : TargetLibCall<__3_YAXPAXABUnothrow_t_std___Z>; - -/// void operator delete(void*, unsigned int); -def TLI_msvc_delete_ptr32_int : TargetLibCall<__3_YAXPAXI_Z>; - -/// void operator delete(void*); -def TLI_msvc_delete_ptr64 : TargetLibCall<__3_YAXPEAX_Z>; - -/// void operator delete(void*, const std::nothrow_t&); -def TLI_msvc_delete_ptr64_nothrow - : TargetLibCall<__3_YAXPEAXAEBUnothrow_t_std___Z>; - -/// void operator delete(void*, unsigned long long); -def TLI_msvc_delete_ptr64_longlong : TargetLibCall<__3_YAXPEAX_K_Z>; - -/// void *operator new[](unsigned int); -def TLI_msvc_new_array_int : TargetLibCall<___U_YAPAXI_Z>; - -/// void *operator new](unsigned int, [const std::nothrow_t&); -def TLI_msvc_new_array_int_nothrow - : TargetLibCall<___U_YAPAXIABUnothrow_t_std___Z>; - -/// void *operator new[](unsigned long long); -def TLI_msvc_new_array_longlong : TargetLibCall<___U_YAPEAX_K_Z>; - -/// void *operator new](unsigned long long, [const std::nothrow_t&); -def TLI_msvc_new_array_longlong_nothrow - : TargetLibCall<___U_YAPEAX_KAEBUnothrow_t_std___Z>; - -/// void operator delete[](void*); -def TLI_msvc_delete_array_ptr32 : TargetLibCall<___V_YAXPAX_Z>; - -/// void operator delete](void*, [const std::nothrow_t&); -def TLI_msvc_delete_array_ptr32_nothrow - : TargetLibCall<___V_YAXPAXABUnothrow_t_std___Z>; - -/// void operator delete](void*, [unsigned int); -def TLI_msvc_delete_array_ptr32_int : TargetLibCall<___V_YAXPAXI_Z>; - -/// void operator delete[](void*); -def TLI_msvc_delete_array_ptr64 : TargetLibCall<___V_YAXPEAX_Z>; - -/// void operator delete](void*, [const std::nothrow_t&); -def TLI_msvc_delete_array_ptr64_nothrow - : TargetLibCall<___V_YAXPEAXAEBUnothrow_t_std___Z>; - -/// void operator delete](void*, [unsigned long long); -def TLI_msvc_delete_array_ptr64_longlong : TargetLibCall<___V_YAXPEAX_K_Z>; - -/// int _IO_getc(_IO_FILE * __fp); -def TLI_under_IO_getc : TargetLibCall<_IO_getc>; - -/// int _IO_putc(int __c, _IO_FILE * __fp); -def TLI_under_IO_putc : TargetLibCall<_IO_putc>; - -/// void operator delete[](void*); -def TLI_ZdaPv : TargetLibCall<_ZdaPv>; - -/// void operator delete](void*, [const std::nothrow_t&); -def TLI_ZdaPvRKSt9nothrow_t : TargetLibCall<_ZdaPvRKSt9nothrow_t>; - -/// void operator delete](void*, [std::align_val_t); -def TLI_ZdaPvSt11align_val_t : TargetLibCall<_ZdaPvSt11align_val_t>; - -/// void operator delete](void*, [std::align_val_t, const std::nothrow_t&) -def TLI_ZdaPvSt11align_val_tRKSt9nothrow_t - : TargetLibCall<_ZdaPvSt11align_val_tRKSt9nothrow_t>; - -/// void operator delete](void*, [unsigned int); -def TLI_ZdaPvj : TargetLibCall<_ZdaPvj>; - -/// void operator delete](void*, [unsigned int, std::align_val_t); -def TLI_ZdaPvjSt11align_val_t : TargetLibCall<_ZdaPvjSt11align_val_t>; - -/// void operator delete](void*, [unsigned long); -def TLI_ZdaPvm : TargetLibCall<_ZdaPvm>; - -/// void operator delete](void*, [unsigned long, std::align_val_t); -def TLI_ZdaPvmSt11align_val_t : TargetLibCall<_ZdaPvmSt11align_val_t>; - -/// void operator delete(void*); -def TLI_ZdlPv : TargetLibCall<_ZdlPv>; - -/// void operator delete(void*, const std::nothrow_t&); -def TLI_ZdlPvRKSt9nothrow_t : TargetLibCall<_ZdlPvRKSt9nothrow_t>; - -/// void operator delete(void*, std::align_val_t) -def TLI_ZdlPvSt11align_val_t : TargetLibCall<_ZdlPvSt11align_val_t>; - -/// void operator delete(void*, std::align_val_t, const std::nothrow_t&) -def TLI_ZdlPvSt11align_val_tRKSt9nothrow_t - : TargetLibCall<_ZdlPvSt11align_val_tRKSt9nothrow_t>; - -/// void operator delete(void*, unsigned int); -def TLI_ZdlPvj : TargetLibCall<_ZdlPvj>; - -/// void operator delete(void*, unsigned int, std::align_val_t) -def TLI_ZdlPvjSt11align_val_t : TargetLibCall<_ZdlPvjSt11align_val_t>; - -/// void operator delete(void*, unsigned long); -def TLI_ZdlPvm : TargetLibCall<_ZdlPvm>; - -/// void operator delete(void*, unsigned long, std::align_val_t) -def TLI_ZdlPvmSt11align_val_t : TargetLibCall<_ZdlPvmSt11align_val_t>; - -/// void *operator new[](unsigned int); -def TLI_Znaj : TargetLibCall<_Znaj>; - -/// void *operator new](unsigned int, [const std::nothrow_t&); -def TLI_ZnajRKSt9nothrow_t : TargetLibCall<_ZnajRKSt9nothrow_t>; - -/// void *operator new](unsigned int, [std::align_val_t) -def TLI_ZnajSt11align_val_t : TargetLibCall<_ZnajSt11align_val_t>; - -/// void *operator new](unsigned int, [std::align_val_t, const std::nothrow_t&) -def TLI_ZnajSt11align_val_tRKSt9nothrow_t - : TargetLibCall<_ZnajSt11align_val_tRKSt9nothrow_t>; - -/// void *operator new[](unsigned long); -def TLI_Znam : TargetLibCall<_Znam>; - -/// void *operator new](unsigned long, [__hot_cold_t) -/// Currently this and other operator new interfaces that take a __hot_cold_t -/// hint are supported by the open source version of tcmalloc, see: -/// https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h -/// and for the definition of the __hot_cold_t parameter see: -/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h -def TLI_Znam12__hot_cold_t : TargetLibCall<_Znam12__hot_cold_t>; - -/// void *operator new](unsigned long, [const std::nothrow_t&); -def TLI_ZnamRKSt9nothrow_t : TargetLibCall<_ZnamRKSt9nothrow_t>; - -/// void *operator new](unsigned long, [const std::nothrow_t&, __hot_cold_t) -def TLI_ZnamRKSt9nothrow_t12__hot_cold_t - : TargetLibCall<_ZnamRKSt9nothrow_t12__hot_cold_t>; - -/// void *operator new](unsigned long, [std::align_val_t) -def TLI_ZnamSt11align_val_t : TargetLibCall<_ZnamSt11align_val_t>; - -/// void *operator new](unsigned long, [std::align_val_t, __hot_cold_t) -def TLI_ZnamSt11align_val_t12__hot_cold_t - : TargetLibCall<_ZnamSt11align_val_t12__hot_cold_t>; - -/// void *operator new](unsigned long, [std::align_val_t, const std::nothrow_t&) -def TLI_ZnamSt11align_val_tRKSt9nothrow_t - : TargetLibCall<_ZnamSt11align_val_tRKSt9nothrow_t>; - -/// void *operator new](unsigned long, [std::align_val_t, const std::nothrow_t&, -/// __hot_cold_t) -def TLI_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t - : TargetLibCall<_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t>; - -/// void *operator new(unsigned int); -def TLI_Znwj : TargetLibCall<_Znwj>; - -/// void *operator new(unsigned int, const std::nothrow_t&); -def TLI_ZnwjRKSt9nothrow_t : TargetLibCall<_ZnwjRKSt9nothrow_t>; - -/// void *operator new(unsigned int, std::align_val_t) -def TLI_ZnwjSt11align_val_t : TargetLibCall<_ZnwjSt11align_val_t>; - -/// void *operator new(unsigned int, std::align_val_t, const std::nothrow_t&) -def TLI_ZnwjSt11align_val_tRKSt9nothrow_t - : TargetLibCall<_ZnwjSt11align_val_tRKSt9nothrow_t>; - -/// void *operator new(unsigned long); -def TLI_Znwm : TargetLibCall<_Znwm>; - -/// void *operator new(unsigned long, __hot_cold_t) -def TLI_Znwm12__hot_cold_t : TargetLibCall<_Znwm12__hot_cold_t>; - -/// void *operator new(unsigned long, const std::nothrow_t&); -def TLI_ZnwmRKSt9nothrow_t : TargetLibCall<_ZnwmRKSt9nothrow_t>; - -/// void *operator new(unsigned long, const std::nothrow_t&, __hot_cold_t) -def TLI_ZnwmRKSt9nothrow_t12__hot_cold_t - : TargetLibCall<_ZnwmRKSt9nothrow_t12__hot_cold_t>; - -/// void *operator new(unsigned long, std::align_val_t) -def TLI_ZnwmSt11align_val_t : TargetLibCall<_ZnwmSt11align_val_t>; - -/// void *operator new(unsigned long, std::align_val_t, __hot_cold_t) -def TLI_ZnwmSt11align_val_t12__hot_cold_t - : TargetLibCall<_ZnwmSt11align_val_t12__hot_cold_t>; - -/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&) -def TLI_ZnwmSt11align_val_tRKSt9nothrow_t - : TargetLibCall<_ZnwmSt11align_val_tRKSt9nothrow_t>; - -/// void *operator new(unsigned long, std::align_val_t, const std::nothrow_t&, -/// __hot_cold_t) -def TLI_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t - : TargetLibCall<_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t>; - -/// The following are variants of operator new which return the actual size -/// reserved by the allocator proposed in P0901R5 (Size feedback in operator -/// new). https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0901r5.html -/// They are implemented by tcmalloc, see source at -/// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h - -/// __sized_ptr_t __size_returning_new(size_t size) -def TLI_size_returning_new : TargetLibCall<__size_returning_new>; - -/// __sized_ptr_t __size_returning_new_hot_cold(size_t, __hot_cold_t) -def TLI_size_returning_new_hot_cold - : TargetLibCall<__size_returning_new_hot_cold>; - -/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t) -def TLI_size_returning_new_aligned - : TargetLibCall<__size_returning_new_aligned>; - -/// __sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t, -/// __hot_cold_t) -def TLI_size_returning_new_aligned_hot_cold - : TargetLibCall<__size_returning_new_aligned_hot_cold>; - -/// double __acos_finite(double x); -def TLI_acos_finite : TargetLibCall<__acos_finite>; - -/// float __acosf_finite(float x); -def TLI_acosf_finite : TargetLibCall<__acos_finitef>; - -/// double __acosh_finite(double x); -def TLI_acosh_finite : TargetLibCall<__acosh_finite>; - -/// float __acoshf_finite(float x); -def TLI_acoshf_finite : TargetLibCall<__acosh_finitef>; - -/// long double __acoshl_finite(long double x); -def TLI_acoshl_finite : TargetLibCall<__acosh_finitel_f128>; - -/// long double __acosl_finite(long double x); -def TLI_acosl_finite : TargetLibCall<__acos_finitel_f128>; - -/// double __asin_finite(double x); -def TLI_asin_finite : TargetLibCall<__asin_finite>; - -/// float __asinf_finite(float x); -def TLI_asinf_finite : TargetLibCall<__asin_finitef>; - -/// long double __asinl_finite(long double x); -def TLI_asinl_finite : TargetLibCall<__asin_finitel_f128>; - -/// double atan2_finite(double y, double x); -def TLI_atan2_finite : TargetLibCall<__atan2_finite>; - -/// float atan2f_finite(float y, float x); -def TLI_atan2f_finite : TargetLibCall<__atan2_finitef>; - -/// long double atan2l_finite(long double y, long double x); -def TLI_atan2l_finite : TargetLibCall<__atan2_finitel_f128>; - -/// double __atanh_finite(double x); -def TLI_atanh_finite : TargetLibCall<__atanh_finite>; - -/// float __atanhf_finite(float x); -def TLI_atanhf_finite : TargetLibCall<__atanh_finitef>; - -/// long double __atanhl_finite(long double x); -def TLI_atanhl_finite : TargetLibCall<__atanh_finitel_f128>; - -/// void __atomic_load(size_t size, void *mptr, void *vptr, int smodel); -def TLI_atomic_load : TargetLibCall<__atomic_load>; - -/// void __atomic_store(size_t size, void *mptr, void *vptr, int smodel); -def TLI_atomic_store : TargetLibCall<__atomic_store>; - -/// double __cosh_finite(double x); -def TLI_cosh_finite : TargetLibCall<__cosh_finite>; - -/// float __coshf_finite(float x); -def TLI_coshf_finite : TargetLibCall<__cosh_finitef>; - -/// long double __coshl_finite(long double x); -def TLI_coshl_finite : TargetLibCall<__cosh_finitel_f128>; - -/// double __cospi(double x); -def TLI_cospi : TargetLibCall<__cospi>; - -/// float __cospif(float x); -def TLI_cospif : TargetLibCall<__cospif>; - -/// int __cxa_atexit(void (*f)(void *), void *p, void *d); -def TLI_cxa_atexit : TargetLibCall<__cxa_atexit>; - -/// int atexit(void (*f)(void)); -def TLI_atexit : TargetLibCall; - -/// void abort(void) -def TLI_abort : TargetLibCall; - -/// void exit(int) -def TLI_exit : TargetLibCall; - -/// void _Exit(int) -def TLI_Exit : TargetLibCall<_Exit>; - -/// void std::terminate(); -def TLI_terminate : TargetLibCall<_ZSt9terminatev>; - -/// void __cxa_throw(void *, void *, void (*)(void *)); -def TLI_cxa_throw : TargetLibCall<__cxa_throw>; - -/// void __cxa_guard_abort(guard_t *guard); -/// guard_t is int64_t in Itanium ABI or int32_t on ARM eabi. -def TLI_cxa_guard_abort : TargetLibCall<__cxa_guard_abort>; - -/// int __cxa_guard_acquire(guard_t *guard); -def TLI_cxa_guard_acquire : TargetLibCall<__cxa_guard_acquire>; - -/// void __cxa_guard_release(guard_t *guard); -def TLI_cxa_guard_release : TargetLibCall<__cxa_guard_release>; - -/// double __exp10_finite(double x); -def TLI_exp10_finite : TargetLibCall<__exp10_finite>; - - -/// float __exp10f_finite(float x); -def TLI_exp10f_finite : TargetLibCall<__exp10_finitef>; - -/// long double __exp10l_finite(long double x); -def TLI_exp10l_finite : TargetLibCall<__exp10_finitel_f128>; - -/// double __exp2_finite(double x); -def TLI_exp2_finite : TargetLibCall<__exp2_finite>; - -/// float __exp2f_finite(float x); -def TLI_exp2f_finite : TargetLibCall<__exp2_finitef>; - -/// long double __exp2l_finite(long double x); -def TLI_exp2l_finite : TargetLibCall<__exp2_finitel_f128>; - -/// double __exp_finite(double x); -def TLI_exp_finite : TargetLibCall<__exp_finite>; - -/// float __expf_finite(float x); -def TLI_expf_finite : TargetLibCall<__exp_finitef>; - -/// long double __expl_finite(long double x); -def TLI_expl_finite : TargetLibCall<__exp_finitel_f128>; - -/// int __isoc99_scanf (const char *format, ...) -def TLI_dunder_isoc99_scanf : TargetLibCall<__isoc99_scanf>; - -/// int __isoc99_sscanf(const char *s, const char *format, ...) -def TLI_dunder_isoc99_sscanf : TargetLibCall<__isoc99_sscanf>; - -/// double __log10_finite(double x); -def TLI_log10_finite : TargetLibCall<__log10_finite>; - -/// float __log10f_finite(float x); -def TLI_log10f_finite : TargetLibCall<__log10_finitef>; - -/// long double __log10l_finite(long double x); -def TLI_log10l_finite : TargetLibCall<__log10_finitel_f128>; - -/// double __log2_finite(double x); -def TLI_log2_finite : TargetLibCall<__log2_finite>; - -/// float __log2f_finite(float x); -def TLI_log2f_finite : TargetLibCall<__log2_finitef>; - -/// long double __log2l_finite(long double x); -def TLI_log2l_finite : TargetLibCall<__log2_finitel_f128>; - -/// double __log_finite(double x); -def TLI_log_finite : TargetLibCall<__log_finite>; - -/// float __logf_finite(float x); -def TLI_logf_finite : TargetLibCall<__log_finitef>; - -/// long double __logl_finite(long double x); -def TLI_logl_finite : TargetLibCall<__log_finitel_f128>; - -/// void *__memccpy_chk(void *dst, const void *src, int c, size_t n, -/// size_t dstsize) -def TLI_memccpy_chk : TargetLibCall<__memccpy_chk>; - -/// void *__memcpy_chk(void *s1, const void *s2, size_t n, size_t s1size); -def TLI_memcpy_chk : TargetLibCall<__memcpy_chk>; - -/// void *__memmove_chk(void *s1, const void *s2, size_t n, size_t s1size); -def TLI_memmove_chk : TargetLibCall<__memmove_chk>; - -/// void *__mempcpy_chk(void *s1, const void *s2, size_t n, size_t s1size); -def TLI_mempcpy_chk : TargetLibCall<__mempcpy_chk>; - -/// void *__memset_chk(void *s, int v, size_t n, size_t s1size); -def TLI_memset_chk : TargetLibCall<__memset_chk>; - -// int __nvvm_reflect(const char *) -def TLI_nvvm_reflect : TargetLibCall<__nvvm_reflect>; - -/// double __pow_finite(double x, double y); -def TLI_pow_finite : TargetLibCall<__pow_finite>; - -/// float _powf_finite(float x, float y); -def TLI_powf_finite : TargetLibCall<__pow_finitef>; - -/// long double __powl_finite(long double x, long double y); -def TLI_powl_finite : TargetLibCall<__pow_finitel_f128>; - -/// double __sincospi_stret(double x); -def TLI_sincospi_stret : TargetLibCall<__sincospi_stret>; - -/// float __sincospif_stret(float x); -def TLI_sincospif_stret : TargetLibCall<__sincospif_stret>; - -/// double __sinh_finite(double x); -def TLI_sinh_finite : TargetLibCall<__sinh_finite>; - -/// float _sinhf_finite(float x); -def TLI_sinhf_finite : TargetLibCall<__sinh_finitef>; - -/// long double __sinhl_finite(long double x); -def TLI_sinhl_finite : TargetLibCall<__sinh_finitel_f128>; - -/// double __sinpi(double x); -def TLI_sinpi : TargetLibCall<__sinpi>; - -/// float __sinpif(float x); -def TLI_sinpif : TargetLibCall<__sinpif>; - -/// int __small_fprintf(FILE *stream, const char *format, ...); -def TLI_small_fprintf : TargetLibCall<__small_fprintf>; - -/// int __small_printf(const char *format, ...); -def TLI_small_printf : TargetLibCall<__small_printf>; - -/// int __small_sprintf(char *str, const char *format, ...); -def TLI_small_sprintf : TargetLibCall<__small_sprintf>; - -/// int __snprintf_chk(char *s, size_t n, int flags, size_t slen, -/// const char *format, ...); -def TLI_snprintf_chk : TargetLibCall<__snprintf_chk>; - -/// int __sprintf_chk(char *str, int flags, size_t str_len, -/// const char *format, ...); -def TLI_sprintf_chk : TargetLibCall<__sprintf_chk>; - -/// double __sqrt_finite(double x); -def TLI_sqrt_finite : TargetLibCall<__sqrt_finite>; - -/// float __sqrt_finite(float x); -def TLI_sqrtf_finite : TargetLibCall<__sqrt_finitef>; - -/// long double __sqrt_finite(long double x); -def TLI_sqrtl_finite : TargetLibCall<__sqrt_finitel_f128>; - -/// char *__stpcpy_chk(char *s1, const char *s2, size_t s1size); -def TLI_stpcpy_chk : TargetLibCall<__stpcpy_chk>; - -/// char *__stpncpy_chk(char *s1, const char *s2, size_t n, size_t s1size); -def TLI_stpncpy_chk : TargetLibCall<__stpncpy_chk>; - -/// char *__strcat_chk(char *s1, const char *s2, size_t s1size); -def TLI_strcat_chk : TargetLibCall<__strcat_chk>; - -/// char *__strcpy_chk(char *s1, const char *s2, size_t s1size); -def TLI_strcpy_chk : TargetLibCall<__strcpy_chk>; - -/// char * __strdup(const char *s); -def TLI_dunder_strdup : TargetLibCall<__strdup>; - -/// size_t __strlcat_chk(char *dst, const char *src, size_t size, -/// size_t dstsize); -def TLI_strlcat_chk : TargetLibCall<__strlcat_chk>; - -/// size_t __strlcpy_chk(char *dst, const char *src, size_t size, -/// size_t dstsize); -def TLI_strlcpy_chk : TargetLibCall<__strlcpy_chk>; - -/// size_t __strlen_chk(const char *s1, size_t s1size); -def TLI_strlen_chk : TargetLibCall<__strlen_chk>; - -/// char *strncat_chk(char *s1, const char *s2, size_t n, size_t s1size); -def TLI_strncat_chk : TargetLibCall<__strncat_chk>; - -/// char *__strncpy_chk(char *s1, const char *s2, size_t n, size_t s1size); -def TLI_strncpy_chk : TargetLibCall<__strncpy_chk>; - -/// char *__strndup(const char *s, size_t n); -def TLI_dunder_strndup : TargetLibCall<__strndup>; - -/// char * __strtok_r(char *s, const char *delim, char **save_ptr); -def TLI_dunder_strtok_r : TargetLibCall<__strtok_r>; - -/// int __vsnprintf_chk(char *s, size_t n, int flags, size_t slen, -/// const char *format, va_list ap); -def TLI_vsnprintf_chk : TargetLibCall<__vsnprintf_chk>; - -/// int __vsprintf_chk(char *s, int flags, size_t slen, const char *format, -/// va_list ap); -def TLI_vsprintf_chk : TargetLibCall<__vsprintf_chk>; - -/// int abs(int j); -def TLI_abs : TargetLibCall; - -/// int access(const char *path, int amode); -def TLI_access : TargetLibCall; - -/// double acos(double x); -def TLI_acos : TargetLibCall; - -/// float acosf(float x); -def TLI_acosf : TargetLibCall; - -/// double acosh(double x); -def TLI_acosh : TargetLibCall; - -/// float acoshf(float x); -def TLI_acoshf : TargetLibCall; - -/// long double acoshl(long double x); -def TLI_acoshl : TargetLibCall; - -/// long double acosl(long double x); -def TLI_acosl : TargetLibCall; - -/// void *aligned_alloc(size_t alignment, size_t size); -def TLI_aligned_alloc : TargetLibCall; - -/// double asin(double x); -def TLI_asin : TargetLibCall; - -/// float asinf(float x); -def TLI_asinf : TargetLibCall; - -/// double asinh(double x); -def TLI_asinh : TargetLibCall; - -/// float asinhf(float x); -def TLI_asinhf : TargetLibCall; - -/// long double asinhl(long double x); -def TLI_asinhl : TargetLibCall; - -/// long double asinl(long double x); -def TLI_asinl : TargetLibCall; - -/// double atan(double x); -def TLI_atan : TargetLibCall; - -/// double atan2(double y, double x); -def TLI_atan2 : TargetLibCall; - -/// float atan2f(float y, float x); -def TLI_atan2f : TargetLibCall; - -/// long double atan2l(long double y, long double x); -def TLI_atan2l : TargetLibCall; - -/// float atanf(float x); -def TLI_atanf : TargetLibCall; - -/// double atanh(double x); -def TLI_atanh : TargetLibCall; - - -/// float atanhf(float x); -def TLI_atanhf : TargetLibCall; - -/// long double atanhl(long double x); -def TLI_atanhl : TargetLibCall; - -/// long double atanl(long double x); -def TLI_atanl : TargetLibCall; - -/// double atof(const char *str); -def TLI_atof : TargetLibCall; - -/// int atoi(const char *str); -def TLI_atoi : TargetLibCall; - -/// long atol(const char *str); -def TLI_atol : TargetLibCall; - -/// long long atoll(const char *nptr); -def TLI_atoll : TargetLibCall; - -/// int bcmp(const void *s1, const void *s2, size_t n); -def TLI_bcmp : TargetLibCall; - -/// void bcopy(const void *s1, void *s2, size_t n); -def TLI_bcopy : TargetLibCall; - -/// void bzero(void *s, size_t n); -def TLI_bzero : TargetLibCall; - -/// double cabs(double complex z) -def TLI_cabs : TargetLibCall; - -/// float cabs(float complex z) -def TLI_cabsf : TargetLibCall; - -/// long double cabs(long double complex z) -def TLI_cabsl : TargetLibCall; - -/// void *calloc(size_t count, size_t size); -def TLI_calloc : TargetLibCall; - -/// double cbrt(double x); -def TLI_cbrt : TargetLibCall; - -/// float cbrtf(float x); -def TLI_cbrtf : TargetLibCall; - -/// long double cbrtl(long double x); -def TLI_cbrtl : TargetLibCall; - -/// double ceil(double x); -def TLI_ceil : TargetLibCall; - -/// float ceilf(float x); -def TLI_ceilf : TargetLibCall; - -/// long double ceill(long double x); -def TLI_ceill : TargetLibCall; - -/// int chmod(const char *path, mode_t mode); -def TLI_chmod : TargetLibCall; - -/// int chown(const char *path, uid_t owner, gid_t group); -def TLI_chown : TargetLibCall; - -/// void clearerr(FILE *stream); -def TLI_clearerr : TargetLibCall; - -/// int closedir(DIR *dirp); -def TLI_closedir : TargetLibCall; - -/// double copysign(double x, double y); -def TLI_copysign : TargetLibCall; - -/// float copysignf(float x, float y); -def TLI_copysignf : TargetLibCall; - -/// long double copysignl(long double x, long double y); -def TLI_copysignl : TargetLibCall; - -/// double cos(double x); -def TLI_cos : TargetLibCall; - -/// float cosf(float x); -def TLI_cosf : TargetLibCall; - -/// double cosh(double x); -def TLI_cosh : TargetLibCall; - -/// float coshf(float x); -def TLI_coshf : TargetLibCall; - -/// long double coshl(long double x); -def TLI_coshl : TargetLibCall; - -/// long double cosl(long double x); -def TLI_cosl : TargetLibCall; - -/// char *ctermid(char *s); -def TLI_ctermid : TargetLibCall; - -/// double erf(double x); -def TLI_erf : TargetLibCall; - -/// float erff(float x); -def TLI_erff : TargetLibCall; - -/// long double erfl(long double x); -def TLI_erfl : TargetLibCall; - -/// double tgamma(double x); -def TLI_tgamma : TargetLibCall; - -/// float tgammaf(float x); -def TLI_tgammaf : TargetLibCall; - -/// long double tgammal(long double x); -def TLI_tgammal : TargetLibCall; - -/// int execl(const char *path, const char *arg, ...); -def TLI_execl : TargetLibCall; - -/// int execle(const char *file, const char *arg, ..., char * const envp[]); -def TLI_execle : TargetLibCall; - -/// int execlp(const char *file, const char *arg, ...); -def TLI_execlp : TargetLibCall; - -/// int execv(const char *path, char *const argv[]); -def TLI_execv : TargetLibCall; - -/// int execvP(const char *file, const char *search_path, char *const argv[]); -def TLI_execvP : TargetLibCall; - -/// int execve(const char *filename, char *const argv], [char *const envp[]); -def TLI_execve : TargetLibCall; - -/// int execvp(const char *file, char *const argv[]); -def TLI_execvp : TargetLibCall; - -/// int execvpe(const char *file, char *const argv], [char *const envp[]); -def TLI_execvpe : TargetLibCall; - -/// double exp(double x); -def TLI_exp : TargetLibCall; - -/// double exp10(double x); -def TLI_exp10 : TargetLibCall; - -/// float exp10f(float x); -def TLI_exp10f : TargetLibCall; - -/// long double exp10l(long double x); -def TLI_exp10l : TargetLibCall; - -/// double exp2(double x); -def TLI_exp2 : TargetLibCall; - -/// float exp2f(float x); -def TLI_exp2f : TargetLibCall; - -/// long double exp2l(long double x); -def TLI_exp2l : TargetLibCall; - -/// float expf(float x); -def TLI_expf : TargetLibCall; - -/// long double expl(long double x); -def TLI_expl : TargetLibCall; - -/// double expm1(double x); -def TLI_expm1 : TargetLibCall; - -/// float expm1f(float x); -def TLI_expm1f : TargetLibCall; - -/// long double expm1l(long double x); -def TLI_expm1l : TargetLibCall; - -/// double fabs(double x); -def TLI_fabs : TargetLibCall; - -/// float fabsf(float x); -def TLI_fabsf : TargetLibCall; - -/// long double fabsl(long double x); -def TLI_fabsl : TargetLibCall; - -/// int fclose(FILE *stream); -def TLI_fclose : TargetLibCall; - -/// FILE *fdopen(int fildes, const char *mode); -def TLI_fdopen : TargetLibCall; - -/// int feof(FILE *stream); -def TLI_feof : TargetLibCall; - -/// int ferror(FILE *stream); -def TLI_ferror : TargetLibCall; - -/// int fflush(FILE *stream); -def TLI_fflush : TargetLibCall; - -/// int ffs(int i); -def TLI_ffs : TargetLibCall; - -/// int ffsl(long int i); -def TLI_ffsl : TargetLibCall; - -/// int ffsll(long long int i); -def TLI_ffsll : TargetLibCall; - -/// int fgetc(FILE *stream); -def TLI_fgetc : TargetLibCall; - -/// int fgetc_unlocked(FILE *stream); -def TLI_fgetc_unlocked : TargetLibCall; - -/// int fgetpos(FILE *stream, fpos_t *pos); -def TLI_fgetpos : TargetLibCall; - -/// char *fgets(char *s, int n, FILE *stream); -def TLI_fgets : TargetLibCall; - -/// char *fgets_unlocked(char *s, int n, FILE *stream); -def TLI_fgets_unlocked : TargetLibCall; - -/// int fileno(FILE *stream); -def TLI_fileno : TargetLibCall; - -/// int fiprintf(FILE *stream, const char *format, ...); -def TLI_fiprintf : TargetLibCall; - -/// void flockfile(FILE *file); -def TLI_flockfile : TargetLibCall; - -/// double floor(double x); -def TLI_floor : TargetLibCall; - -/// float floorf(float x); -def TLI_floorf : TargetLibCall; - -/// long double floorl(long double x); -def TLI_floorl : TargetLibCall; - -/// int fls(int i); -def TLI_fls : TargetLibCall; - -/// int flsl(long int i); -def TLI_flsl : TargetLibCall; - -/// int flsll(long long int i); -def TLI_flsll : TargetLibCall; - -// Calls to fmax and fmin library functions expand to the llvm.maxnnum and -// llvm.minnum intrinsics with the correct parameter types for the arguments -// (all types must match). -/// double fmax(double x, double y); -def TLI_fmax : TargetLibCall; - -/// float fmaxf(float x, float y); -def TLI_fmaxf : TargetLibCall; - -/// long double fmaxl(long double x, long double y); -def TLI_fmaxl : TargetLibCall; - -/// double fmin(double x, double y); -def TLI_fmin : TargetLibCall; - -/// float fminf(float x, float y); -def TLI_fminf : TargetLibCall; - -/// long double fminl(long double x, long double y); -def TLI_fminl : TargetLibCall; - -// Calls to fmaximum_num and fminimum_num library functions expand to the -// llvm.maximumnum and llvm.minimumnum intrinsics with the correct parameter -// types for the arguments (all types must match). -/// double fmaximum_num(double x, double y); -def TLI_fmaximum_num : TargetLibCall; - -/// float fmaximum_numf(float x, float y); -def TLI_fmaximum_numf : TargetLibCall; - -/// long double fmaximum_numl(long double x, long double y); -def TLI_fmaximum_numl : TargetLibCall; - -/// double fminimum_num(double x, double y); -def TLI_fminimum_num : TargetLibCall; - -/// float fminimum_numf(float x, float y); -def TLI_fminimum_numf : TargetLibCall; - -/// long double fminimum_numl(long double x, long double y); -def TLI_fminimum_numl : TargetLibCall; - -/// double fmod(double x, double y); -def TLI_fmod : TargetLibCall; - -/// float fmodf(float x, float y); -def TLI_fmodf : TargetLibCall; - -/// long double fmodl(long double x, long double y); -def TLI_fmodl : TargetLibCall; - -/// FILE *fopen(const char *filename, const char *mode); -def TLI_fopen : TargetLibCall; - -/// FILE *fopen64(const char *filename, const char *opentype) -def TLI_fopen64 : TargetLibCall; - -/// int fork(); -def TLI_fork : TargetLibCall; - -/// int fprintf(FILE *stream, const char *format, ...); -def TLI_fprintf : TargetLibCall; - -/// int fputc(int c, FILE *stream); -def TLI_fputc : TargetLibCall; - -/// int fputc_unlocked(int c, FILE *stream); -def TLI_fputc_unlocked : TargetLibCall; - -/// int fputs(const char *s, FILE *stream); -def TLI_fputs : TargetLibCall; - -/// int fputs_unlocked(const char *s, FILE *stream); -def TLI_fputs_unlocked : TargetLibCall; - -/// size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream); -def TLI_fread : TargetLibCall; - -/// size_t fread_unlocked(void *ptr, size_t size, size_t nitems, FILE *stream); -def TLI_fread_unlocked : TargetLibCall; - -/// void free(void *ptr); -def TLI_free : TargetLibCall; - -/// double frexp(double num, int *exp); -def TLI_frexp : TargetLibCall; - -/// float frexpf(float num, int *exp); -def TLI_frexpf : TargetLibCall; - -/// long double frexpl(long double num, int *exp); -def TLI_frexpl : TargetLibCall; - -/// int fscanf(FILE *stream, const char *format, ... ); -def TLI_fscanf : TargetLibCall; - -/// int fseek(FILE *stream, long offset, int whence); -def TLI_fseek : TargetLibCall; - -/// int fseeko(FILE *stream, off_t offset, int whence); -def TLI_fseeko : TargetLibCall; - -/// int fseeko64(FILE *stream, off64_t offset, int whence) -def TLI_fseeko64 : TargetLibCall; - -/// int fsetpos(FILE *stream, const fpos_t *pos); -def TLI_fsetpos : TargetLibCall; - -/// int fstat(int fildes, struct stat *buf); -def TLI_fstat : TargetLibCall; - -/// int fstat64(int filedes, struct stat64 *buf) -def TLI_fstat64 : TargetLibCall; - -/// int fstatvfs(int fildes, struct statvfs *buf); -def TLI_fstatvfs : TargetLibCall; - -/// int fstatvfs64(int fildes, struct statvfs64 *buf); -def TLI_fstatvfs64 : TargetLibCall; - -/// long ftell(FILE *stream); -def TLI_ftell : TargetLibCall; - -/// off_t ftello(FILE *stream); -def TLI_ftello : TargetLibCall; - -/// off64_t ftello64(FILE *stream) -def TLI_ftello64 : TargetLibCall; - -/// int ftrylockfile(FILE *file); -def TLI_ftrylockfile : TargetLibCall; - -/// void funlockfile(FILE *file); -def TLI_funlockfile : TargetLibCall; - -/// size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream); -def TLI_fwrite : TargetLibCall; - -/// size_t fwrite_unlocked(const void *ptr, size_t size, size_t nitems, -/// FILE *stream); -def TLI_fwrite_unlocked : TargetLibCall; - -/// int getc(FILE *stream); -def TLI_getc : TargetLibCall; - -/// int getc_unlocked(FILE *stream); -def TLI_getc_unlocked : TargetLibCall; - -/// int getchar(void); -def TLI_getchar : TargetLibCall; - -/// int getchar_unlocked(void); -def TLI_getchar_unlocked : TargetLibCall; - -/// char *getenv(const char *name); -def TLI_getenv : TargetLibCall; - -/// int getitimer(int which, struct itimerval *value); -def TLI_getitimer : TargetLibCall; - -/// int getlogin_r(char *name, size_t namesize); -def TLI_getlogin_r : TargetLibCall; - -/// struct passwd *getpwnam(const char *name); -def TLI_getpwnam : TargetLibCall; - -/// char *gets(char *s); -def TLI_gets : TargetLibCall; - -/// int gettimeofday(struct timeval *tp, void *tzp); -def TLI_gettimeofday : TargetLibCall; - -/// uint32_t htonl(uint32_t hostlong); -def TLI_htonl : TargetLibCall; - -/// uint16_t htons(uint16_t hostshort); -def TLI_htons : TargetLibCall; - -/// double hypot(double x, double y); -def TLI_hypot : TargetLibCall; - -/// float hypotf(float x, float y); -def TLI_hypotf : TargetLibCall; - -/// long double hypotl(long double x, long double y); -def TLI_hypotl : TargetLibCall; - -/// int iprintf(const char *format, ...); -def TLI_iprintf : TargetLibCall; - -/// int isascii(int c); -def TLI_isascii : TargetLibCall; - -/// int isdigit(int c); -def TLI_isdigit : TargetLibCall; - -/// long int labs(long int j); -def TLI_labs : TargetLibCall; - -/// int lchown(const char *path, uid_t owner, gid_t group); -def TLI_lchown : TargetLibCall; - -/// double ldexp(double x, int n); -def TLI_ldexp : TargetLibCall; - -/// float ldexpf(float x, int n); -def TLI_ldexpf : TargetLibCall; - -/// long double ldexpl(long double x, int n); -def TLI_ldexpl : TargetLibCall; - -/// long long int llabs(long long int j); -def TLI_llabs : TargetLibCall; - -/// double log(double x); -def TLI_log : TargetLibCall; - -/// double log10(double x); -def TLI_log10 : TargetLibCall; - -/// float log10f(float x); -def TLI_log10f : TargetLibCall; - -/// long double log10l(long double x); -def TLI_log10l : TargetLibCall; - -/// double log1p(double x); -def TLI_log1p : TargetLibCall; - -/// float log1pf(float x); -def TLI_log1pf : TargetLibCall; - -/// long double log1pl(long double x); -def TLI_log1pl : TargetLibCall; - -/// double log2(double x); -def TLI_log2 : TargetLibCall; - -/// float log2f(float x); -def TLI_log2f : TargetLibCall; - -/// double long double log2l(long double x); -def TLI_log2l : TargetLibCall; - -/// int ilogb(double x); -def TLI_ilogb : TargetLibCall; - -/// int ilogbf(float x); -def TLI_ilogbf : TargetLibCall; - -/// int ilogbl(long double x); -def TLI_ilogbl : TargetLibCall; - -/// double logb(double x); -def TLI_logb : TargetLibCall; - -/// float logbf(float x); -def TLI_logbf : TargetLibCall; - -/// long double logbl(long double x); -def TLI_logbl : TargetLibCall; - -/// float logf(float x); -def TLI_logf : TargetLibCall; - -/// long double logl(long double x); -def TLI_logl : TargetLibCall; - -/// int lstat(const char *path, struct stat *buf); -def TLI_lstat : TargetLibCall; - -/// int lstat64(const char *path, struct stat64 *buf); -def TLI_lstat64 : TargetLibCall; - -/// void *malloc(size_t size); -def TLI_malloc : TargetLibCall; - -/// void *memalign(size_t boundary, size_t size); -def TLI_memalign : TargetLibCall; - -/// void *memccpy(void *s1, const void *s2, int c, size_t n); -def TLI_memccpy : TargetLibCall; - -/// void *memchr(const void *s, int c, size_t n); -def TLI_memchr : TargetLibCall; - -/// int memcmp(const void *s1, const void *s2, size_t n); -def TLI_memcmp : TargetLibCall; - -/// void *memcpy(void *s1, const void *s2, size_t n); -def TLI_memcpy : TargetLibCall; - -/// void *memmove(void *s1, const void *s2, size_t n); -def TLI_memmove : TargetLibCall; - -/// void *mempcpy(void *s1, const void *s2, size_t n); -def TLI_mempcpy : TargetLibCall; - -/// void *memrchr(const void *s, int c, size_t n); -def TLI_memrchr : TargetLibCall; - -/// void *memset(void *b, int c, size_t len); -def TLI_memset : TargetLibCall; - -/// void memset_pattern16(void *b, const void *pattern16, size_t len); -def TLI_memset_pattern16 : TargetLibCall; - -/// void memset_pattern4(void *b, const void *pattern4, size_t len); -def TLI_memset_pattern4 : TargetLibCall; - -/// void memset_pattern8(void *b, const void *pattern8, size_t len); -def TLI_memset_pattern8 : TargetLibCall; - -/// int mkdir(const char *path, mode_t mode); -def TLI_mkdir : TargetLibCall; - -/// time_t mktime(struct tm *timeptr); -def TLI_mktime : TargetLibCall; - -/// double modf(double x, double *iptr); -def TLI_modf : TargetLibCall; - -/// float modff(float, float *iptr); -def TLI_modff : TargetLibCall; - -/// long double modfl(long double value, long double *iptr); -def TLI_modfl : TargetLibCall; - -/// double nan(const char *arg); -def TLI_nan : TargetLibCall; - -/// float nanf(const char *arg); -def TLI_nanf : TargetLibCall; - -/// long double nanl(const char *arg); -def TLI_nanl : TargetLibCall; - -/// double nearbyint(double x); -def TLI_nearbyint : TargetLibCall; - -/// float nearbyintf(float x); -def TLI_nearbyintf : TargetLibCall; - -/// long double nearbyintl(long double x); -def TLI_nearbyintl : TargetLibCall; - -/// double nextafter(double x, double y); -def TLI_nextafter : TargetLibCall; - -/// float nextafterf(float x, float y); -def TLI_nextafterf : TargetLibCall; - -/// long double nextafterl(long double x, long double y); -def TLI_nextafterl : TargetLibCall; - -/// double nexttoward(double x, long double y); -def TLI_nexttoward : TargetLibCall; - -/// float nexttowardf(float x, long double y); -def TLI_nexttowardf : TargetLibCall; - -/// long double nexttowardl(long double x, long double y); -def TLI_nexttowardl : TargetLibCall; - -/// uint32_t ntohl(uint32_t netlong); -def TLI_ntohl : TargetLibCall; - -/// uint16_t ntohs(uint16_t netshort); -def TLI_ntohs : TargetLibCall; - -/// int open(const char *path, int oflag, ... ); -def TLI_open : TargetLibCall; - -/// int open64(const char *filename, int flags, [mode_t mode]) -def TLI_open64 : TargetLibCall; - -/// DIR *opendir(const char *dirname); -def TLI_opendir : TargetLibCall; - -/// int pclose(FILE *stream); -def TLI_pclose : TargetLibCall; - -/// void perror(const char *s); -def TLI_perror : TargetLibCall; - -/// FILE *popen(const char *command, const char *mode); -def TLI_popen : TargetLibCall; - -/// int posix_memalign(void **memptr, size_t alignment, size_t size); -def TLI_posix_memalign : TargetLibCall; - -/// double pow(double x, double y); -def TLI_pow : TargetLibCall; - -/// float powf(float x, float y); -def TLI_powf : TargetLibCall; - -/// long double powl(long double x, long double y); -def TLI_powl : TargetLibCall; - -/// ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset); -def TLI_pread : TargetLibCall; - -/// int printf(const char *format, ...); -def TLI_printf : TargetLibCall; - -/// int putc(int c, FILE *stream); -def TLI_putc : TargetLibCall; - -/// int putc_unlocked(int c, FILE *stream); -def TLI_putc_unlocked : TargetLibCall; - -/// int putchar(int c); -def TLI_putchar : TargetLibCall; - -/// int putchar_unlocked(int c); -def TLI_putchar_unlocked : TargetLibCall; - -/// int puts(const char *s); -def TLI_puts : TargetLibCall; - -/// void *pvalloc(size_t size); -def TLI_pvalloc : TargetLibCall; - -/// ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset); -def TLI_pwrite : TargetLibCall; - -/// void qsort(void *base, size_t nel, size_t width, -/// int (*compar)(const void *, const void *)); -def TLI_qsort : TargetLibCall; - -/// ssize_t read(int fildes, void *buf, size_t nbyte); -def TLI_read : TargetLibCall; - -/// ssize_t readlink(const char *path, char *buf, size_t bufsize); -def TLI_readlink : TargetLibCall; - -/// void *realloc(void *ptr, size_t size); -def TLI_realloc : TargetLibCall; - -/// void *reallocf(void *ptr, size_t size); -def TLI_reallocf : TargetLibCall; - -/// void *reallocarray(void *ptr, size_t nmemb, size_t size); -def TLI_reallocarray : TargetLibCall; - -/// char *realpath(const char *file_name, char *resolved_name); -def TLI_realpath : TargetLibCall; - -/// double remainder(double x, double y); -def TLI_remainder : TargetLibCall; - -/// float remainderf(float x, float y); -def TLI_remainderf : TargetLibCall; - -/// long double remainderl(long double x, long double y); -def TLI_remainderl : TargetLibCall; - -/// double remquo(double x, double y, int *quo); -def TLI_remquo : TargetLibCall; - -/// float remquof(float x, float y, int *quo); -def TLI_remquof : TargetLibCall; - -/// long double remquol(long double x, long double y, int *quo); -def TLI_remquol : TargetLibCall; - -/// double fdim(double x, double y); -def TLI_fdim : TargetLibCall; - -/// float fdimf(float x, float y); -def TLI_fdimf : TargetLibCall; - -/// long double fdiml(long double x, long double y); -def TLI_fdiml : TargetLibCall; - -/// int remove(const char *path); -def TLI_remove : TargetLibCall; - -/// int rename(const char *old, const char *new); -def TLI_rename : TargetLibCall; - -/// void rewind(FILE *stream); -def TLI_rewind : TargetLibCall; - -/// double rint(double x); -def TLI_rint : TargetLibCall; - -/// float rintf(float x); -def TLI_rintf : TargetLibCall; - -/// long double rintl(long double x); -def TLI_rintl : TargetLibCall; - -/// int rmdir(const char *path); -def TLI_rmdir : TargetLibCall; - -/// double round(double x); -def TLI_round : TargetLibCall; - -/// double roundeven(double x); -def TLI_roundeven : TargetLibCall; - -/// float roundevenf(float x); -def TLI_roundevenf : TargetLibCall; - -/// long double roundevenl(long double x); -def TLI_roundevenl : TargetLibCall; - -/// float roundf(float x); -def TLI_roundf : TargetLibCall; - -/// long double roundl(long double x); -def TLI_roundl : TargetLibCall; - -/// double scalbln(double arg, long exp); -def TLI_scalbln : TargetLibCall; - -/// float scalblnf(float arg, long exp); -def TLI_scalblnf : TargetLibCall; - -/// long double scalblnl(long double arg, long exp); -def TLI_scalblnl : TargetLibCall; - -/// double scalbn(double arg, int exp); -def TLI_scalbn : TargetLibCall; - -/// float scalbnf(float arg, int exp); -def TLI_scalbnf : TargetLibCall; - -/// long double scalbnl(long double arg, int exp); -def TLI_scalbnl : TargetLibCall; - -/// int scanf(const char *restrict format, ... ); -def TLI_scanf : TargetLibCall; - -/// void setbuf(FILE *stream, char *buf); -def TLI_setbuf : TargetLibCall; - -/// int setitimer(int which, const struct itimerval *value, -/// struct itimerval *ovalue); -def TLI_setitimer : TargetLibCall; - -/// int setvbuf(FILE *stream, char *buf, int type, size_t size); -def TLI_setvbuf : TargetLibCall; - -/// double sin(double x); -def TLI_sin : TargetLibCall; - -/// float sinf(float x); -def TLI_sinf : TargetLibCall; - -/// double sinh(double x); -def TLI_sinh : TargetLibCall; - -/// float sinhf(float x); -def TLI_sinhf : TargetLibCall; - -/// long double sinhl(long double x); -def TLI_sinhl : TargetLibCall; - -/// long double sinl(long double x); -def TLI_sinl : TargetLibCall; - -/// void sincos(double x, double *sin_out, double *cos_out); -def TLI_sincos : TargetLibCall; - -/// void sincosf(float x, float *sin_out, float *cos_out); -def TLI_sincosf : TargetLibCall; - -/// void sincosl(long double x, long double *sin_out, long double *cos_out); -def TLI_sincosl : TargetLibCall; - -/// int siprintf(char *str, const char *format, ...); -def TLI_siprintf : TargetLibCall; - -/// int snprintf(char *s, size_t n, const char *format, ...); -def TLI_snprintf : TargetLibCall; - -/// int sprintf(char *str, const char *format, ...); -def TLI_sprintf : TargetLibCall; - -/// double sqrt(double x); -def TLI_sqrt : TargetLibCall; - -/// float sqrtf(float x); -def TLI_sqrtf : TargetLibCall; - -/// long double sqrtl(long double x); -def TLI_sqrtl : TargetLibCall; - -/// int sscanf(const char *s, const char *format, ... ); -def TLI_sscanf : TargetLibCall; - -/// int stat(const char *path, struct stat *buf); -def TLI_stat : TargetLibCall; - -/// int stat64(const char *path, struct stat64 *buf); -def TLI_stat64 : TargetLibCall; - -/// int statvfs(const char *path, struct statvfs *buf); -def TLI_statvfs : TargetLibCall; - -/// int statvfs64(const char *path, struct statvfs64 *buf) -def TLI_statvfs64 : TargetLibCall; - -/// char *stpcpy(char *s1, const char *s2); -def TLI_stpcpy : TargetLibCall; - -/// char *stpncpy(char *s1, const char *s2, size_t n); -def TLI_stpncpy : TargetLibCall; - -/// int strcasecmp(const char *s1, const char *s2); -def TLI_strcasecmp : TargetLibCall; - -/// char *strcat(char *s1, const char *s2); -def TLI_strcat : TargetLibCall; - -/// char *strchr(const char *s, int c); -def TLI_strchr : TargetLibCall; - -/// int strcmp(const char *s1, const char *s2); -def TLI_strcmp : TargetLibCall; - -/// int strcoll(const char *s1, const char *s2); -def TLI_strcoll : TargetLibCall; - -/// char *strcpy(char *s1, const char *s2); -def TLI_strcpy : TargetLibCall; - -/// size_t strcspn(const char *s1, const char *s2); -def TLI_strcspn : TargetLibCall; - -/// char *strdup(const char *s1); -def TLI_strdup : TargetLibCall; - -/// size_t strlcat(char *dst, const char *src, size_t size); -def TLI_strlcat : TargetLibCall; - -/// size_t strlcpy(char *dst, const char *src, size_t size); -def TLI_strlcpy : TargetLibCall; - -/// size_t strlen(const char *s); -def TLI_strlen : TargetLibCall; - -/// int strncasecmp(const char *s1, const char *s2, size_t n); -def TLI_strncasecmp : TargetLibCall; - -/// char *strncat(char *s1, const char *s2, size_t n); -def TLI_strncat : TargetLibCall; - -/// int strncmp(const char *s1, const char *s2, size_t n); -def TLI_strncmp : TargetLibCall; - -/// char *strncpy(char *s1, const char *s2, size_t n); -def TLI_strncpy : TargetLibCall; - -/// char *strndup(const char *s1, size_t n); -def TLI_strndup : TargetLibCall; - -/// size_t strnlen(const char *s, size_t maxlen); -def TLI_strnlen : TargetLibCall; - -/// char *strpbrk(const char *s1, const char *s2); -def TLI_strpbrk : TargetLibCall; - -/// char *strrchr(const char *s, int c); -def TLI_strrchr : TargetLibCall; - -/// size_t strspn(const char *s1, const char *s2); -def TLI_strspn : TargetLibCall; - -/// char *strstr(const char *s1, const char *s2); -def TLI_strstr : TargetLibCall; - -/// double strtod(const char *nptr, char **endptr); -def TLI_strtod : TargetLibCall; - -/// float strtof(const char *nptr, char **endptr); -def TLI_strtof : TargetLibCall; - -/// char *strtok(char *s1, const char *s2); -def TLI_strtok : TargetLibCall; - -/// char *strtok_r(char *s, const char *sep, char **lasts); -def TLI_strtok_r : TargetLibCall; - -/// long int strtol(const char *nptr, char **endptr, int base); -def TLI_strtol : TargetLibCall; - -/// long double strtold(const char *nptr, char **endptr); -def TLI_strtold : TargetLibCall; - -/// long long int strtoll(const char *nptr, char **endptr, int base); -def TLI_strtoll : TargetLibCall; - -/// unsigned long int strtoul(const char *nptr, char **endptr, int base); -def TLI_strtoul : TargetLibCall; - -/// unsigned long long int strtoull(const char *nptr, char **endptr, int base); -def TLI_strtoull : TargetLibCall; - -/// size_t strxfrm(char *s1, const char *s2, size_t n); -def TLI_strxfrm : TargetLibCall; - -/// int system(const char *command); -def TLI_system : TargetLibCall; - -/// double tan(double x); -def TLI_tan : TargetLibCall; - -/// float tanf(float x); -def TLI_tanf : TargetLibCall; - -/// double tanh(double x); -def TLI_tanh : TargetLibCall; - -/// float tanhf(float x); -def TLI_tanhf : TargetLibCall; - -/// long double tanhl(long double x); -def TLI_tanhl : TargetLibCall; - -/// long double tanl(long double x); -def TLI_tanl : TargetLibCall; - -/// clock_t times(struct tms *buffer); -def TLI_times : TargetLibCall; - -/// FILE *tmpfile(void); -def TLI_tmpfile : TargetLibCall; - -/// FILE *tmpfile64(void) -def TLI_tmpfile64 : TargetLibCall; - -/// int toascii(int c); -def TLI_toascii : TargetLibCall; - -/// double trunc(double x); -def TLI_trunc : TargetLibCall; - -/// float truncf(float x); -def TLI_truncf : TargetLibCall; - -/// long double truncl(long double x); -def TLI_truncl : TargetLibCall; - -/// int uname(struct utsname *name); -def TLI_uname : TargetLibCall; - -/// int ungetc(int c, FILE *stream); -def TLI_ungetc : TargetLibCall; - -/// int unlink(const char *path); -def TLI_unlink : TargetLibCall; - -/// int unsetenv(const char *name); -def TLI_unsetenv : TargetLibCall; - -/// int utime(const char *path, const struct utimbuf *times); -def TLI_utime : TargetLibCall; - -/// int utimes(const char *path, const struct timeval times[2]); -def TLI_utimes : TargetLibCall; - -/// void *valloc(size_t size); -def TLI_valloc : TargetLibCall; - -/// void *vec_calloc(size_t count, size_t size); -def TLI_vec_calloc : TargetLibCall; - -/// void vec_free(void *ptr); -def TLI_vec_free : TargetLibCall; - -/// void *vec_malloc(size_t size); -def TLI_vec_malloc : TargetLibCall; - -/// void *vec_realloc(void *ptr, size_t size); -def TLI_vec_realloc : TargetLibCall; - -/// int vfprintf(FILE *stream, const char *format, va_list ap); -def TLI_vfprintf : TargetLibCall; - -/// int vfscanf(FILE *stream, const char *format, va_list arg); -def TLI_vfscanf : TargetLibCall; - -/// int vprintf(const char *restrict format, va_list ap); -def TLI_vprintf : TargetLibCall; - -/// int vscanf(const char *format, va_list arg); -def TLI_vscanf : TargetLibCall; - -/// int vsnprintf(char *s, size_t n, const char *format, va_list ap); -def TLI_vsnprintf : TargetLibCall; - -/// int vsprintf(char *s, const char *format, va_list ap); -def TLI_vsprintf : TargetLibCall; - -/// int vsscanf(const char *s, const char *format, va_list arg); -def TLI_vsscanf : TargetLibCall; - -/// size_t wcslen (const wchar_t* wcs); -def TLI_wcslen : TargetLibCall; - -/// ssize_t write(int fildes, const void *buf, size_t nbyte); -def TLI_write : TargetLibCall; diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td index 6bbdcdf78faf8..91a29f33b0b0c 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.td +++ b/llvm/include/llvm/IR/RuntimeLibcalls.td @@ -114,15 +114,16 @@ foreach IntTy = ["I32", "I64", "I128"] in { } -class TypeSuffix { +class TypeSuffix { string Suffix = S; + string SuffixLow = SL; FuncArgType Type = Ty; } -def F32 : TypeSuffix<"F32", Flt>; -def F64 : TypeSuffix<"F64", Dbl>; -def F80 : TypeSuffix<"F80", LDbl>; -def F128 : TypeSuffix<"F128", LDbl>; -def PPCF128 : TypeSuffix<"PPCF128", LDbl>; +def F32 : TypeSuffix<"F32", "f", Flt>; +def F64 : TypeSuffix<"F64", "", Dbl>; +def F80 : TypeSuffix<"F80", "_none_enum", LDbl>; +def F128 : TypeSuffix<"F128", "l", LDbl>; +def PPCF128 : TypeSuffix<"PPCF128", "_none_enum", LDbl>; foreach FPTy = [F32, F64, F80, F128, PPCF128] in { def ADD_#FPTy.Suffix : RuntimeLibcall; @@ -137,101 +138,101 @@ foreach FPTy = [F32, F64, F80, F128, PPCF128] in { def DIV_#FPTy.Suffix : RuntimeLibcall; def FAST_DIV_#FPTy.Suffix : RuntimeLibcall; - def REM_#FPTy.Suffix : RuntimeLibcall; + def REM_#FPTy.Suffix : RuntimeLibcall<"fmod"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; def FMA_#FPTy.Suffix : RuntimeLibcall; def POWI_#FPTy.Suffix : RuntimeLibcall; - def SQRT_#FPTy.Suffix : RuntimeLibcall; + def SQRT_#FPTy.Suffix : RuntimeLibcall<"sqrt"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; def FAST_SQRT_#FPTy.Suffix : RuntimeLibcall; - def CBRT_#FPTy.Suffix : RuntimeLibcall; - def LOG_#FPTy.Suffix : RuntimeLibcall; - def LOG_FINITE_#FPTy.Suffix : RuntimeLibcall; - def LOG2_#FPTy.Suffix : RuntimeLibcall; - def LOG2_FINITE_#FPTy.Suffix : RuntimeLibcall; - def LOG10_#FPTy.Suffix : RuntimeLibcall; - def LOG10_FINITE_#FPTy.Suffix : RuntimeLibcall; - def EXP_#FPTy.Suffix : RuntimeLibcall; - def EXP_FINITE_#FPTy.Suffix : RuntimeLibcall; - def EXP2_#FPTy.Suffix : RuntimeLibcall; - def EXP2_FINITE_#FPTy.Suffix : RuntimeLibcall; - def EXP10_#FPTy.Suffix : RuntimeLibcall; - def EXP10_FINITE_#FPTy.Suffix : RuntimeLibcall; - def SIN_#FPTy.Suffix : RuntimeLibcall; - def COS_#FPTy.Suffix : RuntimeLibcall; - def TAN_#FPTy.Suffix : RuntimeLibcall; - def SINH_#FPTy.Suffix : RuntimeLibcall; - def COSH_#FPTy.Suffix : RuntimeLibcall; - def TANH_#FPTy.Suffix : RuntimeLibcall; - def ASIN_#FPTy.Suffix : RuntimeLibcall; - def ACOS_#FPTy.Suffix : RuntimeLibcall; - def ATAN_#FPTy.Suffix : RuntimeLibcall; - def ATAN2_#FPTy.Suffix : RuntimeLibcall; - def SINCOS_#FPTy.Suffix : RuntimeLibcall; - def REMQUO_#FPTy.Suffix : RuntimeLibcall; - def FDIM_#FPTy.Suffix : RuntimeLibcall; - - def CABS_#FPTy.Suffix : RuntimeLibcall; - - def ACOS_FINITE_#FPTy.Suffix : RuntimeLibcall; - def ACOSH_FINITE_#FPTy.Suffix : RuntimeLibcall; - def ASIN_FINITE_#FPTy.Suffix : RuntimeLibcall; - def ATAN2_FINITE_#FPTy.Suffix : RuntimeLibcall; - def ATANH_FINITE_#FPTy.Suffix : RuntimeLibcall; - def COSH_FINITE_#FPTy.Suffix : RuntimeLibcall; - def SINH_FINITE_#FPTy.Suffix : RuntimeLibcall; - def SQRT_FINITE_#FPTy.Suffix : RuntimeLibcall; - def COSPI_#FPTy.Suffix : RuntimeLibcall; - def SINPI_#FPTy.Suffix : RuntimeLibcall; - def ACOSH_#FPTy.Suffix : RuntimeLibcall; - def ASINH_#FPTy.Suffix : RuntimeLibcall; - def ATANH_#FPTy.Suffix : RuntimeLibcall; - def ERF_#FPTy.Suffix : RuntimeLibcall; - def EXPM1_#FPTy.Suffix : RuntimeLibcall; - def FABS_#FPTy.Suffix : RuntimeLibcall; - def HYPOT_#FPTy.Suffix : RuntimeLibcall; - def LOG1P_#FPTy.Suffix : RuntimeLibcall; - def ILOGB_#FPTy.Suffix : RuntimeLibcall; - def LOGB_#FPTy.Suffix : RuntimeLibcall; - def NEXTAFTER_#FPTy.Suffix : RuntimeLibcall; + def CBRT_#FPTy.Suffix : RuntimeLibcall<"cbrt"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def LOG_#FPTy.Suffix : RuntimeLibcall<"log"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def LOG_FINITE_#FPTy.Suffix : RuntimeLibcall<"log"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def LOG2_#FPTy.Suffix : RuntimeLibcall<"log2"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def LOG2_FINITE_#FPTy.Suffix : RuntimeLibcall<"log2"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def LOG10_#FPTy.Suffix : RuntimeLibcall<"log10"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def LOG10_FINITE_#FPTy.Suffix : RuntimeLibcall<"log10"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def EXP_#FPTy.Suffix : RuntimeLibcall<"exp"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def EXP_FINITE_#FPTy.Suffix : RuntimeLibcall<"exp"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def EXP2_#FPTy.Suffix : RuntimeLibcall<"exp2"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def EXP2_FINITE_#FPTy.Suffix : RuntimeLibcall<"exp2"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def EXP10_#FPTy.Suffix : RuntimeLibcall<"exp10"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def EXP10_FINITE_#FPTy.Suffix : RuntimeLibcall<"exp10"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def SIN_#FPTy.Suffix : RuntimeLibcall<"sin"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def COS_#FPTy.Suffix : RuntimeLibcall<"cos"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def TAN_#FPTy.Suffix : RuntimeLibcall<"tan"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def SINH_#FPTy.Suffix : RuntimeLibcall<"sinh"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def COSH_#FPTy.Suffix : RuntimeLibcall<"cosh"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def TANH_#FPTy.Suffix : RuntimeLibcall<"tanh"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ASIN_#FPTy.Suffix : RuntimeLibcall<"asin"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ACOS_#FPTy.Suffix : RuntimeLibcall<"acos"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ATAN_#FPTy.Suffix : RuntimeLibcall<"atan"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ATAN2_#FPTy.Suffix : RuntimeLibcall<"atan2"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; + def SINCOS_#FPTy.Suffix : RuntimeLibcall<"sincos"#FPTy.SuffixLow, Void, [FPTy.Type, Ptr, Ptr]>; + def REMQUO_#FPTy.Suffix : RuntimeLibcall<"remquo"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type, Ptr]>; + def FDIM_#FPTy.Suffix : RuntimeLibcall<"fdim"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; + + def CABS_#FPTy.Suffix : RuntimeLibcall<"cabs"#FPTy.SuffixLow, NoneType, []>; + + def ACOS_FINITE_#FPTy.Suffix : RuntimeLibcall<"acos"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def ACOSH_FINITE_#FPTy.Suffix : RuntimeLibcall<"acosh"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def ASIN_FINITE_#FPTy.Suffix : RuntimeLibcall<"asin"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def ATAN2_FINITE_#FPTy.Suffix : RuntimeLibcall<"atan2"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type, FPTy.Type]>; + def ATANH_FINITE_#FPTy.Suffix : RuntimeLibcall<"atanh"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def COSH_FINITE_#FPTy.Suffix : RuntimeLibcall<"cosh"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def SINH_FINITE_#FPTy.Suffix : RuntimeLibcall<"sinh"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def SQRT_FINITE_#FPTy.Suffix : RuntimeLibcall<"sqrt"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type]>; + def COSPI_#FPTy.Suffix : RuntimeLibcall; + def SINPI_#FPTy.Suffix : RuntimeLibcall; + def ACOSH_#FPTy.Suffix : RuntimeLibcall<"acosh"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ASINH_#FPTy.Suffix : RuntimeLibcall<"asinh"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ATANH_#FPTy.Suffix : RuntimeLibcall<"atanh"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ERF_#FPTy.Suffix : RuntimeLibcall<"erf"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def EXPM1_#FPTy.Suffix : RuntimeLibcall<"expm1"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def FABS_#FPTy.Suffix : RuntimeLibcall<"fabs"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def HYPOT_#FPTy.Suffix : RuntimeLibcall<"hypot"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; + def LOG1P_#FPTy.Suffix : RuntimeLibcall<"log1p"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ILOGB_#FPTy.Suffix : RuntimeLibcall<"ilogb"#FPTy.SuffixLow, Int, [FPTy.Type]>; + def LOGB_#FPTy.Suffix : RuntimeLibcall<"logb"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def NEXTAFTER_#FPTy.Suffix : RuntimeLibcall<"nextafter"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; } -foreach FPTy = [ "F32", "F64" ] in { - def SINCOS_STRET_#FPTy : RuntimeLibcall; - def SINCOSPI_STRET_#FPTy : RuntimeLibcall; +foreach FPTy = [ F32, F64 ] in { + def SINCOS_STRET_#FPTy.Suffix : RuntimeLibcall; + def SINCOSPI_STRET_#FPTy.Suffix : RuntimeLibcall<"sincospi"#FPTy.SuffixLow#"_stret", NoneType, []>; } foreach FPTy = [F32, F64, F80, F128, PPCF128] in { - def POW_#FPTy.Suffix : RuntimeLibcall; - def POW_FINITE_#FPTy.Suffix : RuntimeLibcall; - def CEIL_#FPTy.Suffix : RuntimeLibcall; - def TRUNC_#FPTy.Suffix : RuntimeLibcall; - def RINT_#FPTy.Suffix : RuntimeLibcall; - def NEARBYINT_#FPTy.Suffix : RuntimeLibcall; - def ROUND_#FPTy.Suffix : RuntimeLibcall; - def ROUNDEVEN_#FPTy.Suffix : RuntimeLibcall; - def FLOOR_#FPTy.Suffix : RuntimeLibcall; - def COPYSIGN_#FPTy.Suffix : RuntimeLibcall; - def FMIN_#FPTy.Suffix : RuntimeLibcall; - def FMAX_#FPTy.Suffix : RuntimeLibcall; + def POW_#FPTy.Suffix : RuntimeLibcall<"pow"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; + def POW_FINITE_#FPTy.Suffix : RuntimeLibcall<"pow"#FPTy.SuffixLow#"_finite", FPTy.Type, [FPTy.Type, FPTy.Type]>; + def CEIL_#FPTy.Suffix : RuntimeLibcall<"ceil"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def TRUNC_#FPTy.Suffix : RuntimeLibcall<"trunc"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def RINT_#FPTy.Suffix : RuntimeLibcall<"rint"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def NEARBYINT_#FPTy.Suffix : RuntimeLibcall<"nearbyint"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ROUND_#FPTy.Suffix : RuntimeLibcall<"round"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def ROUNDEVEN_#FPTy.Suffix : RuntimeLibcall<"roundeven"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def FLOOR_#FPTy.Suffix : RuntimeLibcall<"floor"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; + def COPYSIGN_#FPTy.Suffix : RuntimeLibcall<"copysign"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; + def FMIN_#FPTy.Suffix : RuntimeLibcall<"fmin"#FPTy.SuffixLow, Floating, [Same, Same]>; + def FMAX_#FPTy.Suffix : RuntimeLibcall<"fmax"#FPTy.SuffixLow, Floating, [Same, Same]>; def FMINIMUM_#FPTy.Suffix : RuntimeLibcall; def FMAXIMUM_#FPTy.Suffix : RuntimeLibcall; - def FMINIMUM_NUM_#FPTy.Suffix : RuntimeLibcall; - def FMAXIMUM_NUM_#FPTy.Suffix : RuntimeLibcall; + def FMINIMUM_NUM_#FPTy.Suffix : RuntimeLibcall<"fminimum_num"#FPTy.SuffixLow, Floating, [Same, Same]>; + def FMAXIMUM_NUM_#FPTy.Suffix : RuntimeLibcall<"fmaximum_num"#FPTy.SuffixLow, Floating, [Same, Same]>; def LROUND_#FPTy.Suffix : RuntimeLibcall; def LLROUND_#FPTy.Suffix : RuntimeLibcall; def LRINT_#FPTy.Suffix : RuntimeLibcall; def LLRINT_#FPTy.Suffix : RuntimeLibcall; - def LDEXP_#FPTy.Suffix : RuntimeLibcall; - def FREXP_#FPTy.Suffix : RuntimeLibcall; + def LDEXP_#FPTy.Suffix : RuntimeLibcall<"ldexp"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, Int]>; + def FREXP_#FPTy.Suffix : RuntimeLibcall<"frexp"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, Ptr]>; def SINCOSPI_#FPTy.Suffix : RuntimeLibcall; - def MODF_#FPTy.Suffix : RuntimeLibcall; - def NAN_#FPTy.Suffix : RuntimeLibcall; - def NEXTTOWARD_#FPTy.Suffix : RuntimeLibcall; - def REMAINDER_#FPTy.Suffix : RuntimeLibcall; - def SCALBLN_#FPTy.Suffix : RuntimeLibcall; - def SCALBN_#FPTy.Suffix : RuntimeLibcall; - def TGAMMA_#FPTy.Suffix : RuntimeLibcall; + def MODF_#FPTy.Suffix : RuntimeLibcall<"modf"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, Ptr]>; + def NAN_#FPTy.Suffix : RuntimeLibcall<"nan"#FPTy.SuffixLow, FPTy.Type, [Ptr]>; + def NEXTTOWARD_#FPTy.Suffix : RuntimeLibcall<"nexttoward"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, LDbl]>; + def REMAINDER_#FPTy.Suffix : RuntimeLibcall<"remainder"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, FPTy.Type]>; + def SCALBLN_#FPTy.Suffix : RuntimeLibcall<"scalbln"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, Long]>; + def SCALBN_#FPTy.Suffix : RuntimeLibcall<"scalbn"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type, Int]>; + def TGAMMA_#FPTy.Suffix : RuntimeLibcall<"tgamma"#FPTy.SuffixLow, FPTy.Type, [FPTy.Type]>; } defvar F32VectorSuffixes = ["V2F32", "V4F32", "V8F32", "V16F32", "NXV4F32"]; @@ -421,18 +422,18 @@ foreach FPTy = ["F32", "F64", "F128", "PPCF128"] in { } // Memory -def MEMCMP : RuntimeLibcall; -def MEMCPY : RuntimeLibcall; -def MEMCPY_CHK : RuntimeLibcall; -def MEMMOVE : RuntimeLibcall; -def MEMMOVE_CHK : RuntimeLibcall; -def MEMSET : RuntimeLibcall; -def MEMSET_CHK : RuntimeLibcall; -def MALLOC : RuntimeLibcall; -def CALLOC : RuntimeLibcall; -def FREE : RuntimeLibcall; -def BZERO : RuntimeLibcall; -def STRLEN : RuntimeLibcall; +def MEMCMP : RuntimeLibcall<"memcmp", Int, [Ptr, Ptr, SizeT]>; +def MEMCPY : RuntimeLibcall<"memcpy", Ptr, [Ptr, Ptr, SizeT]>; +def MEMCPY_CHK : RuntimeLibcall<"memcpy_chk", Ptr, [Ptr, Ptr, SizeT, SizeT]>; +def MEMMOVE : RuntimeLibcall<"memmove", Ptr, [Ptr, Ptr, SizeT]>; +def MEMMOVE_CHK : RuntimeLibcall<"memmove_chk", Ptr, [Ptr, Ptr, SizeT, SizeT]>; +def MEMSET : RuntimeLibcall<"memset", Ptr, [Ptr, Int, SizeT]>; +def MEMSET_CHK : RuntimeLibcall<"memset_chk", Ptr, [Ptr, Int, SizeT, SizeT]>; +def MALLOC : RuntimeLibcall<"malloc", Ptr, [SizeT]>; +def CALLOC : RuntimeLibcall<"calloc", Ptr, [SizeT, SizeT]>; +def FREE : RuntimeLibcall<"free", Void, [Ptr]>; +def BZERO : RuntimeLibcall<"bzero", Void, [Ptr, SizeT]>; +def STRLEN : RuntimeLibcall<"strlen", SizeT, [Ptr]>; // Element-wise unordered-atomic memory of different sizes foreach MemSize = [1, 2, 4, 8, 16] in { @@ -479,8 +480,8 @@ defset list LibCalls__atomic = { def ATOMIC_COMPARE_EXCHANGE#MemSize : RuntimeLibcall; } - def ATOMIC_LOAD : RuntimeLibcall; - def ATOMIC_STORE : RuntimeLibcall; + def ATOMIC_LOAD : RuntimeLibcall<"atomic_load", Void, [SizeT, Ptr, Ptr, Int]>; + def ATOMIC_STORE : RuntimeLibcall<"atomic_store", Void, [SizeT, Ptr, Ptr, Int]>; foreach MemSize = ["_1", "_2", "_4", "_8", "_16"] in { def ATOMIC_LOAD#MemSize : RuntimeLibcall; def ATOMIC_STORE#MemSize : RuntimeLibcall; @@ -560,6 +561,7 @@ def MIPS16_RET_SF : RuntimeLibcall; // If not provided, it is appended to the def name. multiclass LibmLibcallImpls")> { + let IsTLI = true in { def NAME#"f" : RuntimeLibcallImpl(libcall_basename#"_F32"), !subst("", "f", rtbasename)>; @@ -569,6 +571,7 @@ multiclass LibmLibcallImpls(libcall_basename#"_F128"), !subst("", "l", rtbasename)>; + } def NAME#"l_ppcf128" : RuntimeLibcallImpl(libcall_basename#"_PPCF128"), !subst("", "l", rtbasename)>; @@ -643,304 +646,305 @@ def OBJC_RETAIN_AUTORELEASE : RuntimeLibcall; def OBJC_SYNC_ENTER : RuntimeLibcall; def OBJC_SYNC_EXIT : RuntimeLibcall; -def ABORT : RuntimeLibcall; -def ABS : RuntimeLibcall; -def ACCESS : RuntimeLibcall; -def ALIGNED_ALLOC : RuntimeLibcall; -def ATEXIT : RuntimeLibcall; -def ATOF : RuntimeLibcall; -def ATOI : RuntimeLibcall; -def ATOL : RuntimeLibcall; -def ATOLL : RuntimeLibcall; -def BCMP : RuntimeLibcall; -def BCOPY : RuntimeLibcall; -def CHMOD : RuntimeLibcall; -def CHOWN : RuntimeLibcall; -def CLEARERR : RuntimeLibcall; -def CLOSEDIR : RuntimeLibcall; -def CTERMID : RuntimeLibcall; -def CXA_ATEXIT : RuntimeLibcall; -def CXA_GUARD_ABORT : RuntimeLibcall; -def CXA_GUARD_ACQUIRE : RuntimeLibcall; -def CXA_GUARD_RELEASE : RuntimeLibcall; -def CXA_THROW : RuntimeLibcall; -def DUNDER_ISOC99_SCANF : RuntimeLibcall; -def DUNDER_ISOC99_SSCANF : RuntimeLibcall; -def DUNDER_STRDUP : RuntimeLibcall; -def DUNDER_STRNDUP : RuntimeLibcall; -def DUNDER_STRTOK_R : RuntimeLibcall; +def ABORT : RuntimeLibcall<"abort", Void, []>; +def ABS : RuntimeLibcall<"abs", Int, [Int]>; +def ACCESS : RuntimeLibcall<"access", Int, [Ptr, Int]>; +def ALIGNED_ALLOC : RuntimeLibcall<"aligned_alloc", Ptr, [SizeT, SizeT]>; +def ATEXIT : RuntimeLibcall<"atexit", Int, [Ptr]>; +def ATOF : RuntimeLibcall<"atof", Dbl, [Ptr]>; +def ATOI : RuntimeLibcall<"atoi", Int, [Ptr]>; +def ATOL : RuntimeLibcall<"atol", Long, [Ptr]>; +def ATOLL : RuntimeLibcall<"atoll", LLong, [Ptr]>; +def BCMP : RuntimeLibcall<"bcmp", Int, [Ptr, Ptr, SizeT]>; +def BCOPY : RuntimeLibcall<"bcopy", Void, [Ptr, Ptr, SizeT]>; +def CHMOD : RuntimeLibcall<"chmod", Int, [Ptr, IntX]>; +def CHOWN : RuntimeLibcall<"chown", Int, [Ptr, IntX, IntX]>; +def CLEARERR : RuntimeLibcall<"clearerr", Void, [Ptr]>; +def CLOSEDIR : RuntimeLibcall<"closedir", Int, [Ptr]>; +def CTERMID : RuntimeLibcall<"ctermid", Ptr, [Ptr]>; +def CXA_ATEXIT : RuntimeLibcall<"cxa_atexit", Int, [Ptr, Ptr, Ptr]>; +def CXA_GUARD_ABORT : RuntimeLibcall<"cxa_guard_abort", Void, [Ptr]>; +def CXA_GUARD_ACQUIRE : RuntimeLibcall<"cxa_guard_acquire", Int, [Ptr]>; +def CXA_GUARD_RELEASE : RuntimeLibcall<"cxa_guard_release", Void, [Ptr]>; +def CXA_THROW : RuntimeLibcall<"cxa_throw", Void, [Ptr, Ptr, Ptr]>; +def DUNDER_ISOC99_SCANF : RuntimeLibcall<"dunder_isoc99_scanf", Int, [Ptr, Ellip]>; +def DUNDER_ISOC99_SSCANF : RuntimeLibcall<"dunder_isoc99_sscanf", Int, [Ptr, Ptr, Ellip]>; +def DUNDER_STRDUP : RuntimeLibcall<"dunder_strdup", Ptr, [Ptr]>; +def DUNDER_STRNDUP : RuntimeLibcall<"dunder_strndup", Ptr, [Ptr, SizeT]>; +def DUNDER_STRTOK_R : RuntimeLibcall<"dunder_strtok_r", Ptr, [Ptr, Ptr, Ptr]>; def ENUM_VARIANT : RuntimeLibcall; -def EXECL : RuntimeLibcall; -def EXECLE : RuntimeLibcall; -def EXECLP : RuntimeLibcall; -def EXECV : RuntimeLibcall; -def EXECVE : RuntimeLibcall; -def EXECVP : RuntimeLibcall; -def EXECV_P : RuntimeLibcall; -def EXECVPE : RuntimeLibcall; -def EXIT : RuntimeLibcall; -def FCLOSE : RuntimeLibcall; -def FDOPEN : RuntimeLibcall; -def FEOF : RuntimeLibcall; -def FERROR : RuntimeLibcall; -def FFLUSH : RuntimeLibcall; -def FFS : RuntimeLibcall; -def FFSL : RuntimeLibcall; -def FFSLL : RuntimeLibcall; -def FGETC : RuntimeLibcall; -def FGETC_UNLOCKED : RuntimeLibcall; -def FGETPOS : RuntimeLibcall; -def FGETS : RuntimeLibcall; -def FGETS_UNLOCKED : RuntimeLibcall; -def FILENO : RuntimeLibcall; -def FIPRINTF : RuntimeLibcall; -def FLOCKFILE : RuntimeLibcall; -def FLS : RuntimeLibcall; -def FLSL : RuntimeLibcall; -def FLSLL : RuntimeLibcall; -def FOPEN : RuntimeLibcall; -def FOPEN64 : RuntimeLibcall; -def FORK : RuntimeLibcall; -def FPRINTF : RuntimeLibcall; -def FPUTC : RuntimeLibcall; -def FPUTC_UNLOCKED : RuntimeLibcall; -def FPUTS : RuntimeLibcall; -def FPUTS_UNLOCKED : RuntimeLibcall; -def FREAD : RuntimeLibcall; -def FREAD_UNLOCKED : RuntimeLibcall; -def FSCANF : RuntimeLibcall; -def FSEEK : RuntimeLibcall; -def FSEEKO : RuntimeLibcall; -def FSEEKO64 : RuntimeLibcall; -def FSETPOS : RuntimeLibcall; -def FSTAT : RuntimeLibcall; -def FSTAT64 : RuntimeLibcall; -def FSTATVFS : RuntimeLibcall; -def FSTATVFS64 : RuntimeLibcall; -def FTELL : RuntimeLibcall; -def FTELLO : RuntimeLibcall; -def FTELLO64 : RuntimeLibcall; -def FTRYLOCKFILE : RuntimeLibcall; -def FUNLOCKFILE : RuntimeLibcall; -def FWRITE : RuntimeLibcall; -def FWRITE_UNLOCKED : RuntimeLibcall; -def GETC : RuntimeLibcall; -def GETCHAR : RuntimeLibcall; -def GETCHAR_UNLOCKED : RuntimeLibcall; -def GETC_UNLOCKED : RuntimeLibcall; -def GETENV : RuntimeLibcall; -def GETITIMER : RuntimeLibcall; -def GETLOGIN_R : RuntimeLibcall; -def GETPWNAM : RuntimeLibcall; -def GETS : RuntimeLibcall; -def GETTIMEOFDAY : RuntimeLibcall; -def HTONL : RuntimeLibcall; -def HTONS : RuntimeLibcall; -def IPRINTF : RuntimeLibcall; -def ISASCII : RuntimeLibcall; -def ISDIGIT : RuntimeLibcall; -def LABS : RuntimeLibcall; -def LCHOWN : RuntimeLibcall; -def LLABS : RuntimeLibcall; -def LSTAT : RuntimeLibcall; -def LSTAT64 : RuntimeLibcall; -def MEMALIGN : RuntimeLibcall; -def MEMCCPY : RuntimeLibcall; -def MEMCCPY_CHK : RuntimeLibcall; -def MEMCHR : RuntimeLibcall; -def MEMPCPY : RuntimeLibcall; -def MEMPCPY_CHK : RuntimeLibcall; -def MEMRCHR : RuntimeLibcall; -def MEMSET_PATTERN16 : RuntimeLibcall; -def MEMSET_PATTERN4 : RuntimeLibcall; -def MEMSET_PATTERN8 : RuntimeLibcall; -def MKDIR : RuntimeLibcall; -def MKTIME : RuntimeLibcall; -def MSVC_DELETE_ARRAY_PTR32 : RuntimeLibcall; -def MSVC_DELETE_ARRAY_PTR32_INT : RuntimeLibcall; -def MSVC_DELETE_ARRAY_PTR32_NOTHROW : RuntimeLibcall; -def MSVC_DELETE_ARRAY_PTR64 : RuntimeLibcall; -def MSVC_DELETE_ARRAY_PTR64_LONGLONG : RuntimeLibcall; -def MSVC_DELETE_ARRAY_PTR64_NOTHROW : RuntimeLibcall; -def MSVC_DELETE_PTR32 : RuntimeLibcall; -def MSVC_DELETE_PTR32_INT : RuntimeLibcall; -def MSVC_DELETE_PTR32_NOTHROW : RuntimeLibcall; -def MSVC_DELETE_PTR64 : RuntimeLibcall; -def MSVC_DELETE_PTR64_LONGLONG : RuntimeLibcall; -def MSVC_DELETE_PTR64_NOTHROW : RuntimeLibcall; -def MSVC_NEW_ARRAY_INT : RuntimeLibcall; -def MSVC_NEW_ARRAY_INT_NOTHROW : RuntimeLibcall; -def MSVC_NEW_ARRAY_LONGLONG : RuntimeLibcall; -def MSVC_NEW_ARRAY_LONGLONG_NOTHROW : RuntimeLibcall; -def MSVC_NEW_INT : RuntimeLibcall; -def MSVC_NEW_INT_NOTHROW : RuntimeLibcall; -def MSVC_NEW_LONGLONG : RuntimeLibcall; -def MSVC_NEW_LONGLONG_NOTHROW : RuntimeLibcall; -def NTOHL : RuntimeLibcall; -def NTOHS : RuntimeLibcall; -def OPEN : RuntimeLibcall; -def OPEN64 : RuntimeLibcall; -def OPENDIR : RuntimeLibcall; -def PCLOSE : RuntimeLibcall; -def PERROR : RuntimeLibcall; -def POPEN : RuntimeLibcall; -def POSIX_MEMALIGN : RuntimeLibcall; -def PREAD : RuntimeLibcall; -def PRINTF : RuntimeLibcall; -def PUTC : RuntimeLibcall; -def PUTCHAR : RuntimeLibcall; -def PUTCHAR_UNLOCKED : RuntimeLibcall; -def PUTC_UNLOCKED : RuntimeLibcall; -def PUTS : RuntimeLibcall; -def PVALLOC : RuntimeLibcall; -def PWRITE : RuntimeLibcall; -def QSORT : RuntimeLibcall; -def READ : RuntimeLibcall; -def READLINK : RuntimeLibcall; -def REALLOC : RuntimeLibcall; -def REALLOCARRAY : RuntimeLibcall; -def REALLOCF : RuntimeLibcall; -def REALPATH : RuntimeLibcall; -def REMOVE : RuntimeLibcall; -def RENAME : RuntimeLibcall; -def REWIND : RuntimeLibcall; -def RMDIR : RuntimeLibcall; -def SCANF : RuntimeLibcall; -def SETBUF : RuntimeLibcall; -def SETITIMER : RuntimeLibcall; -def SETVBUF : RuntimeLibcall; -def SIPRINTF : RuntimeLibcall; -def SIZE_RETURNING_NEW : RuntimeLibcall; -def SIZE_RETURNING_NEW_ALIGNED : RuntimeLibcall; -def SIZE_RETURNING_NEW_ALIGNED_HOT_COLD : RuntimeLibcall; -def SIZE_RETURNING_NEW_HOT_COLD : RuntimeLibcall; -def SMALL_FPRINTF : RuntimeLibcall; -def SMALL_PRINTF : RuntimeLibcall; -def SMALL_SPRINTF : RuntimeLibcall; -def SNPRINTF : RuntimeLibcall; -def SNPRINTF_CHK : RuntimeLibcall; -def SPRINTF : RuntimeLibcall; -def SPRINTF_CHK : RuntimeLibcall; -def SSCANF : RuntimeLibcall; -def STAT : RuntimeLibcall; -def STAT64 : RuntimeLibcall; -def STATVFS : RuntimeLibcall; -def STATVFS64 : RuntimeLibcall; -def STPCPY : RuntimeLibcall; -def STPCPY_CHK : RuntimeLibcall; -def STPNCPY : RuntimeLibcall; -def STPNCPY_CHK : RuntimeLibcall; -def STRCASECMP : RuntimeLibcall; -def STRCAT : RuntimeLibcall; -def STRCAT_CHK : RuntimeLibcall; -def STRCHR : RuntimeLibcall; -def STRCMP : RuntimeLibcall; -def STRCOLL : RuntimeLibcall; -def STRCPY : RuntimeLibcall; -def STRCPY_CHK : RuntimeLibcall; -def STRCSPN : RuntimeLibcall; -def STRDUP : RuntimeLibcall; -def STRLCAT : RuntimeLibcall; -def STRLCAT_CHK : RuntimeLibcall; -def STRLCPY : RuntimeLibcall; -def STRLCPY_CHK : RuntimeLibcall; -def STRLEN_CHK : RuntimeLibcall; -def STRNCASECMP : RuntimeLibcall; -def STRNCAT : RuntimeLibcall; -def STRNCAT_CHK : RuntimeLibcall; -def STRNCMP : RuntimeLibcall; -def STRNCPY : RuntimeLibcall; -def STRNCPY_CHK : RuntimeLibcall; -def STRNDUP : RuntimeLibcall; -def STRNLEN : RuntimeLibcall; -def STRPBRK : RuntimeLibcall; -def STRRCHR : RuntimeLibcall; -def STRSPN : RuntimeLibcall; -def STRSTR : RuntimeLibcall; -def STRTOD : RuntimeLibcall; -def STRTOF : RuntimeLibcall; -def STRTOK : RuntimeLibcall; -def STRTOK_R : RuntimeLibcall; -def STRTOL : RuntimeLibcall; -def STRTOLD : RuntimeLibcall; -def STRTOLL : RuntimeLibcall; -def STRTOUL : RuntimeLibcall; -def STRTOULL : RuntimeLibcall; -def STRXFRM : RuntimeLibcall; -def SYSTEM : RuntimeLibcall; -def TERMINATE : RuntimeLibcall; -def TIMES : RuntimeLibcall; -def TMPFILE : RuntimeLibcall; -def TMPFILE64 : RuntimeLibcall; -def TOASCII : RuntimeLibcall; -def UNAME : RuntimeLibcall; -def UNDER_IO_GETC : RuntimeLibcall; -def UNDER_IO_PUTC : RuntimeLibcall; -def UNGETC : RuntimeLibcall; -def UNLINK : RuntimeLibcall; -def UNSETENV : RuntimeLibcall; -def UTIME : RuntimeLibcall; -def UTIMES : RuntimeLibcall; -def VALLOC : RuntimeLibcall; -def VEC_CALLOC : RuntimeLibcall; -def VEC_FREE : RuntimeLibcall; -def VEC_MALLOC : RuntimeLibcall; -def VEC_REALLOC : RuntimeLibcall; -def VFPRINTF : RuntimeLibcall; -def VFSCANF : RuntimeLibcall; -def VPRINTF : RuntimeLibcall; -def VSCANF : RuntimeLibcall; -def VSNPRINTF : RuntimeLibcall; -def VSNPRINTF_CHK : RuntimeLibcall; -def VSPRINTF : RuntimeLibcall; -def VSPRINTF_CHK : RuntimeLibcall; -def VSSCANF : RuntimeLibcall; -def WCSLEN : RuntimeLibcall; -def WRITE : RuntimeLibcall; -def ZDAPV : RuntimeLibcall; -def ZDAPVJ : RuntimeLibcall; -def ZDAPVJST11ALIGN_VAL_T : RuntimeLibcall; -def ZDAPVM : RuntimeLibcall; -def ZDAPVMST11ALIGN_VAL_T : RuntimeLibcall; -def ZDAPVRKST9NOTHROW_T : RuntimeLibcall; -def ZDAPVST11ALIGN_VAL_T : RuntimeLibcall; -def ZDAPVST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall; -def ZDLPV : RuntimeLibcall; -def ZDLPVJ : RuntimeLibcall; -def ZDLPVJST11ALIGN_VAL_T : RuntimeLibcall; -def ZDLPVM : RuntimeLibcall; -def ZDLPVMST11ALIGN_VAL_T : RuntimeLibcall; -def ZDLPVRKST9NOTHROW_T : RuntimeLibcall; -def ZDLPVST11ALIGN_VAL_T : RuntimeLibcall; -def ZDLPVST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall; -def ZNAJ : RuntimeLibcall; -def ZNAJRKST9NOTHROW_T : RuntimeLibcall; -def ZNAJST11ALIGN_VAL_T : RuntimeLibcall; -def ZNAJST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall; -def ZNAM : RuntimeLibcall; -def ZNAM12__HOT_COLD_T : RuntimeLibcall; -def ZNAMRKST9NOTHROW_T : RuntimeLibcall; -def ZNAMRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall; -def ZNAMST11ALIGN_VAL_T : RuntimeLibcall; -def ZNAMST11ALIGN_VAL_T12__HOT_COLD_T : RuntimeLibcall; -def ZNAMST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall; -def ZNAMST11ALIGN_VAL_TRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall; -def ZNWJ : RuntimeLibcall; -def ZNWJRKST9NOTHROW_T : RuntimeLibcall; -def ZNWJST11ALIGN_VAL_T : RuntimeLibcall; -def ZNWJST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall; -def ZNWM : RuntimeLibcall; -def ZNWM12__HOT_COLD_T : RuntimeLibcall; -def ZNWMRKST9NOTHROW_T : RuntimeLibcall; -def ZNWMRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall; -def ZNWMST11ALIGN_VAL_T : RuntimeLibcall; -def ZNWMST11ALIGN_VAL_T12__HOT_COLD_T : RuntimeLibcall; -def ZNWMST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall; -def ZNWMST11ALIGN_VAL_TRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall; -def KMPC_ALLOC_SHARED : RuntimeLibcall; -def KMPC_FREE_SHARED : RuntimeLibcall; - -def NVVM_REFLECT : RuntimeLibcall; +def EXECL : RuntimeLibcall<"execl", Int, [Ptr, Ptr, Ellip]>; +def EXECLE : RuntimeLibcall<"execle", Int, [Ptr, Ptr, Ellip]>; +def EXECLP : RuntimeLibcall<"execlp", Int, [Ptr, Ptr, Ellip]>; +def EXECV : RuntimeLibcall<"execv", Int, [Ptr, Ptr]>; +def EXECVE : RuntimeLibcall<"execve", Int, [Ptr, Ptr, Ptr]>; +def EXECVP : RuntimeLibcall<"execvp", Int, [Ptr, Ptr]>; +def EXECV_P : RuntimeLibcall<"execvP", Int, [Ptr, Ptr, Ptr]>; +def EXECVPE : RuntimeLibcall<"execvpe", Int, [Ptr, Ptr, Ptr]>; +def EXIT : RuntimeLibcall<"exit", Void, [Int]>; +def EXIT_1 : RuntimeLibcall<"Exit", Void, [Int]>; +def FCLOSE : RuntimeLibcall<"fclose", Int, [Ptr]>; +def FDOPEN : RuntimeLibcall<"fdopen", Ptr, [Int, Ptr]>; +def FEOF : RuntimeLibcall<"feof", Int, [Ptr]>; +def FERROR : RuntimeLibcall<"ferror", Int, [Ptr]>; +def FFLUSH : RuntimeLibcall<"fflush", Int, [Ptr]>; +def FFS : RuntimeLibcall<"ffs", Int, [Int]>; +def FFSL : RuntimeLibcall<"ffsl", Int, [Long]>; +def FFSLL : RuntimeLibcall<"ffsll", Int, [LLong]>; +def FGETC : RuntimeLibcall<"fgetc", Int, [Ptr]>; +def FGETC_UNLOCKED : RuntimeLibcall<"fgetc_unlocked", Int, [Ptr]>; +def FGETPOS : RuntimeLibcall<"fgetpos", Int, [Ptr, Ptr]>; +def FGETS : RuntimeLibcall<"fgets", Ptr, [Ptr, Int, Ptr]>; +def FGETS_UNLOCKED : RuntimeLibcall<"fgets_unlocked", Ptr, [Ptr, Int, Ptr]>; +def FILENO : RuntimeLibcall<"fileno", Int, [Ptr]>; +def FIPRINTF : RuntimeLibcall<"fiprintf", Int, [Ptr, Ptr, Ellip]>; +def FLOCKFILE : RuntimeLibcall<"flockfile", Void, [Ptr]>; +def FLS : RuntimeLibcall<"fls", Int, [Int]>; +def FLSL : RuntimeLibcall<"flsl", Int, [Long]>; +def FLSLL : RuntimeLibcall<"flsll", Int, [LLong]>; +def FOPEN : RuntimeLibcall<"fopen", Ptr, [Ptr, Ptr]>; +def FOPEN64 : RuntimeLibcall<"fopen64", Ptr, [Ptr, Ptr]>; +def FORK : RuntimeLibcall<"fork", Int, []>; +def FPRINTF : RuntimeLibcall<"fprintf", Int, [Ptr, Ptr, Ellip]>; +def FPUTC : RuntimeLibcall<"fputc", Int, [Int, Ptr]>; +def FPUTC_UNLOCKED : RuntimeLibcall<"fputc_unlocked", Int, [Int, Ptr]>; +def FPUTS : RuntimeLibcall<"fputs", Int, [Ptr, Ptr]>; +def FPUTS_UNLOCKED : RuntimeLibcall<"fputs_unlocked", Int, [Ptr, Ptr]>; +def FREAD : RuntimeLibcall<"fread", SizeT, [Ptr, SizeT, SizeT, Ptr]>; +def FREAD_UNLOCKED : RuntimeLibcall<"fread_unlocked", SizeT, [Ptr, SizeT, SizeT, Ptr]>; +def FSCANF : RuntimeLibcall<"fscanf", Int, [Ptr, Ptr, Ellip]>; +def FSEEK : RuntimeLibcall<"fseek", Int, [Ptr, Long, Int]>; +def FSEEKO : RuntimeLibcall<"fseeko", Int, [Ptr, IntX, Int]>; +def FSEEKO64 : RuntimeLibcall<"fseeko64", Int, [Ptr, Int64, Int]>; +def FSETPOS : RuntimeLibcall<"fsetpos", Int, [Ptr, Ptr]>; +def FSTAT : RuntimeLibcall<"fstat", Int, [Int, Ptr]>; +def FSTAT64 : RuntimeLibcall<"fstat64", Int, [Int, Ptr]>; +def FSTATVFS : RuntimeLibcall<"fstatvfs", Int, [Int, Ptr]>; +def FSTATVFS64 : RuntimeLibcall<"fstatvfs64", Int, [Int, Ptr]>; +def FTELL : RuntimeLibcall<"ftell", Long, [Ptr]>; +def FTELLO : RuntimeLibcall<"ftello", IntPlus, [Ptr]>; +def FTELLO64 : RuntimeLibcall<"ftello64", Int64, [Ptr]>; +def FTRYLOCKFILE : RuntimeLibcall<"ftrylockfile", Int, [Ptr]>; +def FUNLOCKFILE : RuntimeLibcall<"funlockfile", Void, [Ptr]>; +def FWRITE : RuntimeLibcall<"fwrite", SizeT, [Ptr, SizeT, SizeT, Ptr]>; +def FWRITE_UNLOCKED : RuntimeLibcall<"fwrite_unlocked", SizeT, [Ptr, SizeT, SizeT, Ptr]>; +def GETC : RuntimeLibcall<"getc", Int, [Ptr]>; +def GETCHAR : RuntimeLibcall<"getchar", Int, []>; +def GETCHAR_UNLOCKED : RuntimeLibcall<"getchar_unlocked", Int, []>; +def GETC_UNLOCKED : RuntimeLibcall<"getc_unlocked", Int, [Ptr]>; +def GETENV : RuntimeLibcall<"getenv", Ptr, [Ptr]>; +def GETITIMER : RuntimeLibcall<"getitimer", Int, [Int, Ptr]>; +def GETLOGIN_R : RuntimeLibcall<"getlogin_r", Int, [Ptr, SizeT]>; +def GETPWNAM : RuntimeLibcall<"getpwnam", Ptr, [Ptr]>; +def GETS : RuntimeLibcall<"gets", Ptr, [Ptr]>; +def GETTIMEOFDAY : RuntimeLibcall<"gettimeofday", Int, [Ptr, Ptr]>; +def HTONL : RuntimeLibcall<"htonl", Int32, [Int32]>; +def HTONS : RuntimeLibcall<"htons", Int16, [Int16]>; +def IPRINTF : RuntimeLibcall<"iprintf", Int, [Ptr, Ellip]>; +def ISASCII : RuntimeLibcall<"isascii", Int, [Int]>; +def ISDIGIT : RuntimeLibcall<"isdigit", Int, [Int]>; +def LABS : RuntimeLibcall<"labs", Long, [Same]>; +def LCHOWN : RuntimeLibcall<"lchown", Int, [Ptr, IntX, IntX]>; +def LLABS : RuntimeLibcall<"llabs", LLong, [LLong]>; +def LSTAT : RuntimeLibcall<"lstat", Int, [Ptr, Ptr]>; +def LSTAT64 : RuntimeLibcall<"lstat64", Int, [Ptr, Ptr]>; +def MEMALIGN : RuntimeLibcall<"memalign", Ptr, [SizeT, SizeT]>; +def MEMCCPY : RuntimeLibcall<"memccpy", Ptr, [Ptr, Ptr, Int, SizeT]>; +def MEMCCPY_CHK : RuntimeLibcall<"memccpy_chk", Ptr, [Ptr, Ptr, Int, SizeT, SizeT]>; +def MEMCHR : RuntimeLibcall<"memchr", Ptr, [Ptr, Int, SizeT]>; +def MEMPCPY : RuntimeLibcall<"mempcpy", Ptr, [Ptr, Ptr, SizeT]>; +def MEMPCPY_CHK : RuntimeLibcall<"mempcpy_chk", Ptr, [Ptr, Ptr, SizeT, SizeT]>; +def MEMRCHR : RuntimeLibcall<"memrchr", Ptr, [Ptr, Int, SizeT]>; +def MEMSET_PATTERN16 : RuntimeLibcall<"memset_pattern16", Void, [Ptr, Ptr, SizeT]>; +def MEMSET_PATTERN4 : RuntimeLibcall<"memset_pattern4", Void, [Ptr, Ptr, SizeT]>; +def MEMSET_PATTERN8 : RuntimeLibcall<"memset_pattern8", Void, [Ptr, Ptr, SizeT]>; +def MKDIR : RuntimeLibcall<"mkdir", Int, [Ptr, IntX]>; +def MKTIME : RuntimeLibcall<"mktime", IntPlus, [Ptr]>; +def MSVC_DELETE_ARRAY_PTR32 : RuntimeLibcall<"msvc_delete_array_ptr32", Void, [Ptr]>; +def MSVC_DELETE_ARRAY_PTR32_INT : RuntimeLibcall<"msvc_delete_array_ptr32_int", Void, [Ptr, Int]>; +def MSVC_DELETE_ARRAY_PTR32_NOTHROW : RuntimeLibcall<"msvc_delete_array_ptr32_nothrow", Void, [Ptr, Ptr]>; +def MSVC_DELETE_ARRAY_PTR64 : RuntimeLibcall<"msvc_delete_array_ptr64", Void, [Ptr]>; +def MSVC_DELETE_ARRAY_PTR64_LONGLONG : RuntimeLibcall<"msvc_delete_array_ptr64_longlong", Void, [Ptr, LLong]>; +def MSVC_DELETE_ARRAY_PTR64_NOTHROW : RuntimeLibcall<"msvc_delete_array_ptr64_nothrow", Void, [Ptr, Ptr]>; +def MSVC_DELETE_PTR32 : RuntimeLibcall<"msvc_delete_ptr32", Void, [Ptr]>; +def MSVC_DELETE_PTR32_INT : RuntimeLibcall<"msvc_delete_ptr32_int", Void, [Ptr, Int]>; +def MSVC_DELETE_PTR32_NOTHROW : RuntimeLibcall<"msvc_delete_ptr32_nothrow", Void, [Ptr, Ptr]>; +def MSVC_DELETE_PTR64 : RuntimeLibcall<"msvc_delete_ptr64", Void, [Ptr]>; +def MSVC_DELETE_PTR64_LONGLONG : RuntimeLibcall<"msvc_delete_ptr64_longlong", Void, [Ptr, LLong]>; +def MSVC_DELETE_PTR64_NOTHROW : RuntimeLibcall<"msvc_delete_ptr64_nothrow", Void, [Ptr, Ptr]>; +def MSVC_NEW_ARRAY_INT : RuntimeLibcall<"msvc_new_array_int", Ptr, [Int]>; +def MSVC_NEW_ARRAY_INT_NOTHROW : RuntimeLibcall<"msvc_new_array_int_nothrow", Ptr, [Int, Ptr]>; +def MSVC_NEW_ARRAY_LONGLONG : RuntimeLibcall<"msvc_new_array_longlong", Ptr, [LLong]>; +def MSVC_NEW_ARRAY_LONGLONG_NOTHROW : RuntimeLibcall<"msvc_new_array_longlong_nothrow", Ptr, [LLong, Ptr]>; +def MSVC_NEW_INT : RuntimeLibcall<"msvc_new_int", Ptr, [Int]>; +def MSVC_NEW_INT_NOTHROW : RuntimeLibcall<"msvc_new_int_nothrow", Ptr, [Int, Ptr]>; +def MSVC_NEW_LONGLONG : RuntimeLibcall<"msvc_new_longlong", Ptr, [LLong]>; +def MSVC_NEW_LONGLONG_NOTHROW : RuntimeLibcall<"msvc_new_longlong_nothrow", Ptr, [LLong, Ptr]>; +def NTOHL : RuntimeLibcall<"ntohl", Int32, [Int32]>; +def NTOHS : RuntimeLibcall<"ntohs", Int16, [Int16]>; +def OPEN : RuntimeLibcall<"open", Int, [Ptr, Int, Ellip]>; +def OPEN64 : RuntimeLibcall<"open64", Int, [Ptr, Int, Ellip]>; +def OPENDIR : RuntimeLibcall<"opendir", Ptr, [Ptr]>; +def PCLOSE : RuntimeLibcall<"pclose", Int, [Ptr]>; +def PERROR : RuntimeLibcall<"perror", Void, [Ptr]>; +def POPEN : RuntimeLibcall<"popen", Ptr, [Ptr, Ptr]>; +def POSIX_MEMALIGN : RuntimeLibcall<"posix_memalign", Int, [Ptr, SizeT, SizeT]>; +def PREAD : RuntimeLibcall<"pread", SSizeT, [Int, Ptr, SizeT, IntPlus]>; +def PRINTF : RuntimeLibcall<"printf", Int, [Ptr, Ellip]>; +def PUTC : RuntimeLibcall<"putc", Int, [Int, Ptr]>; +def PUTCHAR : RuntimeLibcall<"putchar", Int, [Int]>; +def PUTCHAR_UNLOCKED : RuntimeLibcall<"putchar_unlocked", Int, [Int]>; +def PUTC_UNLOCKED : RuntimeLibcall<"putc_unlocked", Int, [Int, Ptr]>; +def PUTS : RuntimeLibcall<"puts", Int, [Ptr]>; +def PVALLOC : RuntimeLibcall<"pvalloc", Ptr, [SizeT]>; +def PWRITE : RuntimeLibcall<"pwrite", SSizeT, [Int, Ptr, SizeT, IntPlus]>; +def QSORT : RuntimeLibcall<"qsort", Void, [Ptr, SizeT, SizeT, Ptr]>; +def READ : RuntimeLibcall<"read", SSizeT, [Int, Ptr, SizeT]>; +def READLINK : RuntimeLibcall<"readlink", SSizeT, [Ptr, Ptr, SizeT]>; +def REALLOC : RuntimeLibcall<"realloc", Ptr, [Ptr, SizeT]>; +def REALLOCARRAY : RuntimeLibcall<"reallocarray", Ptr, [Ptr, SizeT, SizeT]>; +def REALLOCF : RuntimeLibcall<"reallocf", Ptr, [Ptr, SizeT]>; +def REALPATH : RuntimeLibcall<"realpath", Ptr, [Ptr, Ptr]>; +def REMOVE : RuntimeLibcall<"remove", Int, [Ptr]>; +def RENAME : RuntimeLibcall<"rename", Int, [Ptr, Ptr]>; +def REWIND : RuntimeLibcall<"rewind", Void, [Ptr]>; +def RMDIR : RuntimeLibcall<"rmdir", Int, [Ptr]>; +def SCANF : RuntimeLibcall<"scanf", Int, [Ptr, Ellip]>; +def SETBUF : RuntimeLibcall<"setbuf", Void, [Ptr, Ptr]>; +def SETITIMER : RuntimeLibcall<"setitimer", Int, [Int, Ptr, Ptr]>; +def SETVBUF : RuntimeLibcall<"setvbuf", Int, [Ptr, Ptr, Int, SizeT]>; +def SIPRINTF : RuntimeLibcall<"siprintf", Int, [Ptr, Ptr, Ellip]>; +def SIZE_RETURNING_NEW : RuntimeLibcall<"size_returning_new", NoneType, []>; +def SIZE_RETURNING_NEW_ALIGNED : RuntimeLibcall<"size_returning_new_aligned", NoneType, []>; +def SIZE_RETURNING_NEW_ALIGNED_HOT_COLD : RuntimeLibcall<"size_returning_new_aligned_hot_cold", NoneType, []>; +def SIZE_RETURNING_NEW_HOT_COLD : RuntimeLibcall<"size_returning_new_hot_cold", NoneType, []>; +def SMALL_FPRINTF : RuntimeLibcall<"small_fprintf", Int, [Ptr, Ptr, Ellip]>; +def SMALL_PRINTF : RuntimeLibcall<"small_printf", Int, [Ptr, Ellip]>; +def SMALL_SPRINTF : RuntimeLibcall<"small_sprintf", Int, [Ptr, Ptr, Ellip]>; +def SNPRINTF : RuntimeLibcall<"snprintf", Int, [Ptr, SizeT, Ptr, Ellip]>; +def SNPRINTF_CHK : RuntimeLibcall<"snprintf_chk", Int, [Ptr, SizeT, Int, SizeT, Ptr, Ellip]>; +def SPRINTF : RuntimeLibcall<"sprintf", Int, [Ptr, Ptr, Ellip]>; +def SPRINTF_CHK : RuntimeLibcall<"sprintf_chk", Int, [Ptr, Int, SizeT, Ptr, Ellip]>; +def SSCANF : RuntimeLibcall<"sscanf", Int, [Ptr, Ptr, Ellip]>; +def STAT : RuntimeLibcall<"stat", Int, [Ptr, Ptr]>; +def STAT64 : RuntimeLibcall<"stat64", Int, [Ptr, Ptr]>; +def STATVFS : RuntimeLibcall<"statvfs", Int, [Ptr, Ptr]>; +def STATVFS64 : RuntimeLibcall<"statvfs64", Int, [Ptr, Ptr]>; +def STPCPY : RuntimeLibcall<"stpcpy", Ptr, [Ptr, Ptr]>; +def STPCPY_CHK : RuntimeLibcall<"stpcpy_chk", Ptr, [Ptr, Ptr, SizeT]>; +def STPNCPY : RuntimeLibcall<"stpncpy", Ptr, [Ptr, Ptr, SizeT]>; +def STPNCPY_CHK : RuntimeLibcall<"stpncpy_chk", Ptr, [Ptr, Ptr, SizeT, SizeT]>; +def STRCASECMP : RuntimeLibcall<"strcasecmp", Int, [Ptr, Ptr]>; +def STRCAT : RuntimeLibcall<"strcat", Ptr, [Ptr, Ptr]>; +def STRCAT_CHK : RuntimeLibcall<"strcat_chk", Ptr, [Ptr, Ptr, SizeT]>; +def STRCHR : RuntimeLibcall<"strchr", Ptr, [Ptr, Int]>; +def STRCMP : RuntimeLibcall<"strcmp", Int, [Ptr, Ptr]>; +def STRCOLL : RuntimeLibcall<"strcoll", Int, [Ptr, Ptr]>; +def STRCPY : RuntimeLibcall<"strcpy", Ptr, [Ptr, Ptr]>; +def STRCPY_CHK : RuntimeLibcall<"strcpy_chk", Ptr, [Ptr, Ptr, SizeT]>; +def STRCSPN : RuntimeLibcall<"strcspn", SizeT, [Ptr, Ptr]>; +def STRDUP : RuntimeLibcall<"strdup", Ptr, [Ptr]>; +def STRLCAT : RuntimeLibcall<"strlcat", SizeT, [Ptr, Ptr, SizeT]>; +def STRLCAT_CHK : RuntimeLibcall<"strlcat_chk", SizeT, [Ptr, Ptr, SizeT, SizeT]>; +def STRLCPY : RuntimeLibcall<"strlcpy", SizeT, [Ptr, Ptr, SizeT]>; +def STRLCPY_CHK : RuntimeLibcall<"strlcpy_chk", SizeT, [Ptr, Ptr, SizeT, SizeT]>; +def STRLEN_CHK : RuntimeLibcall<"strlen_chk", SizeT, [Ptr, SizeT]>; +def STRNCASECMP : RuntimeLibcall<"strncasecmp", Int, [Ptr, Ptr, SizeT]>; +def STRNCAT : RuntimeLibcall<"strncat", Ptr, [Ptr, Ptr, SizeT]>; +def STRNCAT_CHK : RuntimeLibcall<"strncat_chk", Ptr, [Ptr, Ptr, SizeT, SizeT]>; +def STRNCMP : RuntimeLibcall<"strncmp", Int, [Ptr, Ptr, SizeT]>; +def STRNCPY : RuntimeLibcall<"strncpy", Ptr, [Ptr, Ptr, SizeT]>; +def STRNCPY_CHK : RuntimeLibcall<"strncpy_chk", Ptr, [Ptr, Ptr, SizeT, SizeT]>; +def STRNDUP : RuntimeLibcall<"strndup", Ptr, [Ptr, SizeT]>; +def STRNLEN : RuntimeLibcall<"strnlen", SizeT, [Ptr, SizeT]>; +def STRPBRK : RuntimeLibcall<"strpbrk", Ptr, [Ptr, Ptr]>; +def STRRCHR : RuntimeLibcall<"strrchr", Ptr, [Ptr, Int]>; +def STRSPN : RuntimeLibcall<"strspn", SizeT, [Ptr, Ptr]>; +def STRSTR : RuntimeLibcall<"strstr", Ptr, [Ptr, Ptr]>; +def STRTOD : RuntimeLibcall<"strtod", Dbl, [Ptr, Ptr]>; +def STRTOF : RuntimeLibcall<"strtof", Flt, [Ptr, Ptr]>; +def STRTOK : RuntimeLibcall<"strtok", Ptr, [Ptr, Ptr]>; +def STRTOK_R : RuntimeLibcall<"strtok_r", Ptr, [Ptr, Ptr, Ptr]>; +def STRTOL : RuntimeLibcall<"strtol", Long, [Ptr, Ptr, Int]>; +def STRTOLD : RuntimeLibcall<"strtold", LDbl, [Ptr, Ptr]>; +def STRTOLL : RuntimeLibcall<"strtoll", LLong, [Ptr, Ptr, Int]>; +def STRTOUL : RuntimeLibcall<"strtoul", Long, [Ptr, Ptr, Int]>; +def STRTOULL : RuntimeLibcall<"strtoull", LLong, [Ptr, Ptr, Int]>; +def STRXFRM : RuntimeLibcall<"strxfrm", SizeT, [Ptr, Ptr, SizeT]>; +def SYSTEM : RuntimeLibcall<"system", Int, [Ptr]>; +def TERMINATE : RuntimeLibcall<"terminate", Void, []>; +def TIMES : RuntimeLibcall<"times", IntPlus, [Ptr]>; +def TMPFILE : RuntimeLibcall<"tmpfile", Ptr, []>; +def TMPFILE64 : RuntimeLibcall<"tmpfile64", Ptr, []>; +def TOASCII : RuntimeLibcall<"toascii", Int, [Int]>; +def UNAME : RuntimeLibcall<"uname", Int, [Ptr]>; +def UNDER_IO_GETC : RuntimeLibcall<"under_IO_getc", Int, [Ptr]>; +def UNDER_IO_PUTC : RuntimeLibcall<"under_IO_putc", Int, [Int, Ptr]>; +def UNGETC : RuntimeLibcall<"ungetc", Int, [Int, Ptr]>; +def UNLINK : RuntimeLibcall<"unlink", Int, [Ptr]>; +def UNSETENV : RuntimeLibcall<"unsetenv", Int, [Ptr]>; +def UTIME : RuntimeLibcall<"utime", Int, [Ptr, Ptr]>; +def UTIMES : RuntimeLibcall<"utimes", Int, [Ptr, Ptr]>; +def VALLOC : RuntimeLibcall<"valloc", Ptr, [SizeT]>; +def VEC_CALLOC : RuntimeLibcall<"vec_calloc", Ptr, [SizeT, SizeT]>; +def VEC_FREE : RuntimeLibcall<"vec_free", Void, [Ptr]>; +def VEC_MALLOC : RuntimeLibcall<"vec_malloc", Ptr, [SizeT]>; +def VEC_REALLOC : RuntimeLibcall<"vec_realloc", Ptr, [Ptr, SizeT]>; +def VFPRINTF : RuntimeLibcall<"vfprintf", Int, [Ptr, Ptr, Ptr]>; +def VFSCANF : RuntimeLibcall<"vfscanf", Int, [Ptr, Ptr, Ptr]>; +def VPRINTF : RuntimeLibcall<"vprintf", Int, [Ptr, Ptr]>; +def VSCANF : RuntimeLibcall<"vscanf", Int, [Ptr, Ptr]>; +def VSNPRINTF : RuntimeLibcall<"vsnprintf", Int, [Ptr, SizeT, Ptr, Ptr]>; +def VSNPRINTF_CHK : RuntimeLibcall<"vsnprintf_chk", Int, [Ptr, SizeT, Int, SizeT, Ptr, Ptr]>; +def VSPRINTF : RuntimeLibcall<"vsprintf", Int, [Ptr, Ptr, Ptr]>; +def VSPRINTF_CHK : RuntimeLibcall<"vsprintf_chk", Int, [Ptr, Int, SizeT, Ptr, Ptr]>; +def VSSCANF : RuntimeLibcall<"vsscanf", Int, [Ptr, Ptr, Ptr]>; +def WCSLEN : RuntimeLibcall<"wcslen", SizeT, [Ptr]>; +def WRITE : RuntimeLibcall<"write", SSizeT, [Int, Ptr, SizeT]>; +def ZDAPV : RuntimeLibcall<"ZdaPv", Void, [Ptr]>; +def ZDAPVJ : RuntimeLibcall<"ZdaPvj", Void, [Ptr, Int]>; +def ZDAPVJST11ALIGN_VAL_T : RuntimeLibcall<"ZdaPvjSt11align_val_t", Void, [Ptr, Int, Int]>; +def ZDAPVM : RuntimeLibcall<"ZdaPvm", Void, [Ptr, Long]>; +def ZDAPVMST11ALIGN_VAL_T : RuntimeLibcall<"ZdaPvmSt11align_val_t", Void, [Ptr, Long, Long]>; +def ZDAPVRKST9NOTHROW_T : RuntimeLibcall<"ZdaPvRKSt9nothrow_t", Void, [Ptr, Ptr]>; +def ZDAPVST11ALIGN_VAL_T : RuntimeLibcall<"ZdaPvSt11align_val_t", Void, [Ptr, IntPlus]>; +def ZDAPVST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall<"ZdaPvSt11align_val_tRKSt9nothrow_t", Void, [Ptr, IntPlus, Ptr]>; +def ZDLPV : RuntimeLibcall<"ZdlPv", Void, [Ptr]>; +def ZDLPVJ : RuntimeLibcall<"ZdlPvj", Void, [Ptr, Int]>; +def ZDLPVJST11ALIGN_VAL_T : RuntimeLibcall<"ZdlPvjSt11align_val_t", Void, [Ptr, Int, Int]>; +def ZDLPVM : RuntimeLibcall<"ZdlPvm", Void, [Ptr, Long]>; +def ZDLPVMST11ALIGN_VAL_T : RuntimeLibcall<"ZdlPvmSt11align_val_t", Void, [Ptr, Long, Long]>; +def ZDLPVRKST9NOTHROW_T : RuntimeLibcall<"ZdlPvRKSt9nothrow_t", Void, [Ptr, Ptr]>; +def ZDLPVST11ALIGN_VAL_T : RuntimeLibcall<"ZdlPvSt11align_val_t", Void, [Ptr, IntPlus]>; +def ZDLPVST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall<"ZdlPvSt11align_val_tRKSt9nothrow_t", Void, [Ptr, IntPlus, Ptr]>; +def ZNAJ : RuntimeLibcall<"Znaj", Ptr, [Int]>; +def ZNAJRKST9NOTHROW_T : RuntimeLibcall<"ZnajRKSt9nothrow_t", Ptr, [Int, Ptr]>; +def ZNAJST11ALIGN_VAL_T : RuntimeLibcall<"ZnajSt11align_val_t", Ptr, [Int, Int]>; +def ZNAJST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall<"ZnajSt11align_val_tRKSt9nothrow_t", Ptr, [Int, Int, Ptr]>; +def ZNAM : RuntimeLibcall<"Znam", Ptr, [Long]>; +def ZNAM12__HOT_COLD_T : RuntimeLibcall<"Znam12__hot_cold_t", Ptr, [Long, Bool]>; +def ZNAMRKST9NOTHROW_T : RuntimeLibcall<"ZnamRKSt9nothrow_t", Ptr, [Long, Ptr]>; +def ZNAMRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall<"ZnamRKSt9nothrow_t12__hot_cold_t", Ptr, [Long, Ptr, Bool]>; +def ZNAMST11ALIGN_VAL_T : RuntimeLibcall<"ZnamSt11align_val_t", Ptr, [Long, Long]>; +def ZNAMST11ALIGN_VAL_T12__HOT_COLD_T : RuntimeLibcall<"ZnamSt11align_val_t12__hot_cold_t", Ptr, [Long, Long, Bool]>; +def ZNAMST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall<"ZnamSt11align_val_tRKSt9nothrow_t", Ptr, [Long, Long, Ptr]>; +def ZNAMST11ALIGN_VAL_TRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall<"ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t", Ptr, [Long, Long, Ptr, Bool]>; +def ZNWJ : RuntimeLibcall<"Znwj", Ptr, [Int]>; +def ZNWJRKST9NOTHROW_T : RuntimeLibcall<"ZnwjRKSt9nothrow_t", Ptr, [Int, Ptr]>; +def ZNWJST11ALIGN_VAL_T : RuntimeLibcall<"ZnwjSt11align_val_t", Ptr, [Int, Int]>; +def ZNWJST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall<"ZnwjSt11align_val_tRKSt9nothrow_t", Ptr, [Int, Int, Ptr]>; +def ZNWM : RuntimeLibcall<"Znwm", Ptr, [Long]>; +def ZNWM12__HOT_COLD_T : RuntimeLibcall<"Znwm12__hot_cold_t", Ptr, [Long, Bool]>; +def ZNWMRKST9NOTHROW_T : RuntimeLibcall<"ZnwmRKSt9nothrow_t", Ptr, [Long, Ptr]>; +def ZNWMRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall<"ZnwmRKSt9nothrow_t12__hot_cold_t", Ptr, [Long, Ptr, Bool]>; +def ZNWMST11ALIGN_VAL_T : RuntimeLibcall<"ZnwmSt11align_val_t", Ptr, [Long, Long]>; +def ZNWMST11ALIGN_VAL_T12__HOT_COLD_T : RuntimeLibcall<"ZnwmSt11align_val_t12__hot_cold_t", Ptr, [Long, Long, Bool]>; +def ZNWMST11ALIGN_VAL_TRKST9NOTHROW_T : RuntimeLibcall<"ZnwmSt11align_val_tRKSt9nothrow_t", Ptr, [Long, Long, Ptr]>; +def ZNWMST11ALIGN_VAL_TRKST9NOTHROW_T12__HOT_COLD_T : RuntimeLibcall<"ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t", Ptr, [Long, Long, Ptr, Bool]>; +def KMPC_ALLOC_SHARED : RuntimeLibcall; +def KMPC_FREE_SHARED : RuntimeLibcall; + +def NVVM_REFLECT : RuntimeLibcall<"nvvm_reflect", Int, [Ptr]>; //-------------------------------------------------------------------- // Global variable references @@ -1329,6 +1333,8 @@ def __stack_chk_fail : RuntimeLibcallImpl; /// // -------------------------------------------------------------------- +let IsTLI = true in { + def __2_YAPAXI_Z : RuntimeLibcallImpl; def __2_YAPAXIABUnothrow_t_std___Z : RuntimeLibcallImpl; def atexit : RuntimeLibcallImpl; def abort : RuntimeLibcallImpl; def exit : RuntimeLibcallImpl; -def _Exit : RuntimeLibcallImpl; +def _Exit : RuntimeLibcallImpl; def _ZSt9terminatev : RuntimeLibcallImpl; def __cxa_throw : RuntimeLibcallImpl; def __cxa_guard_abort : RuntimeLibcallImpl; @@ -1665,6 +1671,8 @@ def vsscanf : RuntimeLibcallImpl; def wcslen : RuntimeLibcallImpl; def write : RuntimeLibcallImpl; +} // End let IsTLI = true + defm __acos_finite : LibmLibcallImpls<"ACOS_FINITE", "__acos_finite">; defm __acosh_finite : LibmLibcallImpls<"ACOSH_FINITE", "__acosh_finite">; defm __asin_finite : LibmLibcallImpls<"ASIN_FINITE", "__asin_finite">; @@ -1688,11 +1696,14 @@ defm ilogb : LibmLibcallImpls; defm logb : LibmLibcallImpls; defm nextafter : LibmLibcallImpls; -def __nvvm_reflect : RuntimeLibcallImpl; +let IsTLI = true in { +def __nvvm_reflect : RuntimeLibcallImpl; def __sincospif_stret : RuntimeLibcallImpl; def __sincospi_stret : RuntimeLibcallImpl; +} + //-------------------------------------------------------------------- // compiler-rt/libgcc but 64-bit only, not available by default //-------------------------------------------------------------------- @@ -4442,3 +4453,18 @@ defset list AMDLIBM_VECFUNCS = { def amd_vrd4_round : RuntimeLibcallImpl; def amd_vrd8_round : RuntimeLibcallImpl; } + +//===----------------------------------------------------------------------===// +// TargetLibraryInfo +//===----------------------------------------------------------------------===// + +defvar TLIRuntimeLibcallImplsBase + = !filter(entry, !instances(), entry.IsTLI); +defvar TLIRuntimeLibcallImpls = (add TLIRuntimeLibcallImplsBase, + DefaultRuntimeLibcallImplsBaseList, + bzero); + +def isDefaultTLI : RuntimeLibcallPredicate<"!(TT.isSystemZ() && TT.isOSzOS())">; +def LegacyTLILibrary : TLILibrary; + +def SystemZZOSTLILibrary : TLILibrary; diff --git a/llvm/include/llvm/IR/RuntimeLibcallsImpl.td b/llvm/include/llvm/IR/RuntimeLibcallsImpl.td index 06c1fccc6ac37..332165f776627 100644 --- a/llvm/include/llvm/IR/RuntimeLibcallsImpl.td +++ b/llvm/include/llvm/IR/RuntimeLibcallsImpl.td @@ -77,9 +77,10 @@ def Same : FuncArgType; // Same argument type as the previous one. /// When adding PPCF128 functions here, note that their names generally need /// to be overridden for Darwin with the xxx$LDBL128 form. See /// PPCISelLowering.cpp. -class RuntimeLibcall ArgTypes = []> { string Name = NAME; + string LibFuncEnumName = EnumName; // For TargetLibraryInfo FuncArgType ReturnType = RetType; list ArgumentTypes = ArgTypes; } @@ -91,6 +92,7 @@ class RuntimeLibcallImpl { RuntimeLibcall Provides = P; string LibCallFuncName = Name; bit IsDefault = false; + bit IsTLI = false; } class LibcallImpls { RuntimeLibcallImpl RTLibcallImpl = LibcallImpl; } +/// Define a set of library functions for a target for TargetLibraryInfo. +class TLILibrary { + RuntimeLibcallPredicate TriplePred = Pred; + dag MemberList = funcList; +} diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 6b8f861392254..1b27ca2886394 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -129,6 +129,8 @@ static void initializeBase(TargetLibraryInfoImpl &TLI, const Triple &T) { static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T, const llvm::StringTable &StandardNames, VectorLibrary VecLib) { + TLI.setTargetLibraryLibcallSets(T); + // Set IO unlocked variants as unavailable // Set them as available per system below TLI.setUnavailable(LibFunc_getc_unlocked); diff --git a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp index b558236a0979d..50a713ca8b48a 100644 --- a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp +++ b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp @@ -138,7 +138,7 @@ static void dumpTLIEntries(const TargetLibraryInfo &TLI) { printPrintableName(outs(), TLI.getName(LF)); } else { // If it's not available, refer to it by the standard name. - printPrintableName(outs(), TargetLibraryInfo::getStandardName(LF)); + printPrintableName(outs(), TLI.getStandardName(LF)); } outs() << '\n'; diff --git a/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp b/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp index da1c853c3a774..b24894c6c361f 100644 --- a/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp +++ b/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp @@ -41,11 +41,22 @@ class TargetLibraryInfoEmitter { } // End anonymous namespace. +static StringRef getEnumName(const Record *Libcall) { + return Libcall->getValueAsString("LibFuncEnumName"); +} + TargetLibraryInfoEmitter::TargetLibraryInfoEmitter(const RecordKeeper &R) : Records(R) { ArrayRef All = - Records.getAllDerivedDefinitions("TargetLibCall"); - AllTargetLibcalls.append(All.begin(), All.end()); + Records.getAllDerivedDefinitions("RuntimeLibcall"); + // AllTargetLibcalls.append(All.begin(), All.end()); + + for (const Record *R : All) { + StringRef EnumName = getEnumName(R); + if (!EnumName.empty() && !EnumName.contains("_none_enum")) + AllTargetLibcalls.push_back(R); + } + // Make sure that the records are in the same order as the input. // TODO Find a better sorting order when all is migrated. sort(AllTargetLibcalls, [](const Record *A, const Record *B) { @@ -57,16 +68,17 @@ TargetLibraryInfoEmitter::TargetLibraryInfoEmitter(const RecordKeeper &R) // function. void TargetLibraryInfoEmitter::emitTargetLibraryInfoEnum( raw_ostream &OS) const { + IfDefEmitter IfDef(OS, "GET_TARGET_LIBRARY_INFO_ENUM"); OS << "enum LibFunc : unsigned {\n"; OS.indent(2) << "NotLibFunc = 0,\n"; for (const auto *R : AllTargetLibcalls) - OS.indent(2) << "LibFunc_" << R->getName().drop_front(4) << ",\n"; + OS.indent(2) << "LibFunc_" << getEnumName(R) << ",\n"; OS.indent(2) << "NumLibFuncs,\n"; OS.indent(2) << "End_LibFunc = NumLibFuncs,\n"; if (AllTargetLibcalls.size()) { OS.indent(2) << "Begin_LibFunc = LibFunc_" - << AllTargetLibcalls[0]->getName().drop_front(4) << ",\n"; + << getEnumName(AllTargetLibcalls[0]) << ",\n"; } else { OS.indent(2) << "Begin_LibFunc = NotLibFunc,\n"; } @@ -79,48 +91,80 @@ void TargetLibraryInfoEmitter::emitTargetLibraryInfoEnum( void TargetLibraryInfoEmitter::emitTargetLibraryInfoStringTable( raw_ostream &OS) const { - auto getFuncName = [](const Record *R) -> StringRef { - R = R->getValueAsDef("RTLibcallImpl"); - return R->getValueAsString("LibCallFuncName"); - }; - - llvm::StringToOffsetTable Table( - /*AppendZero=*/true, - "TargetLibraryInfoImpl::", /*UsePrefixForStorageMember=*/false); - for (const auto *R : AllTargetLibcalls) - Table.GetOrAddStringOffset(getFuncName(R)); + ArrayRef AllLibs = + Records.getAllDerivedDefinitions("TLILibrary"); + DenseMap Libcall2Impl; size_t NumEl = AllTargetLibcalls.size() + 1; + auto getFuncName = [&Libcall2Impl](const Record *Libcall) -> StringRef { + auto It = Libcall2Impl.find(Libcall); + if (It == Libcall2Impl.end()) + return ""; + return It->second->getValueAsString("LibCallFuncName"); + }; + { - IfDefEmitter IfDef(OS, "GET_TARGET_LIBRARY_INFO_STRING_TABLE"); - Table.EmitStringTableDef(OS, "StandardNamesStrTable"); - OS << "\n"; - OS << "const llvm::StringTable::Offset " - "TargetLibraryInfoImpl::StandardNamesOffsets[" - << NumEl - << "] = " - "{\n"; - OS.indent(2) << "0, //\n"; - for (const auto *R : AllTargetLibcalls) { - StringRef Str = getFuncName(R); - OS.indent(2) << Table.GetStringOffset(Str) << ", // " << Str << "\n"; + IfDefEmitter IfDef(OS, "GET_TARGET_LIBRARY_INFO_STRING_TABLE"); + + OS << "void TargetLibraryInfoImpl::setTargetLibraryLibcallSets(" + "const Triple &TT) {\n"; + for (const Record *Lib : AllLibs) { + + const Record *Pred = Lib->getValueAsDef("TriplePred"); + OS.indent(2) << "if (" << Pred->getValueAsString("Cond") << ") {\n"; + + SetTheory ST; + SetTheory::RecSet Impls; + ST.evaluate(Lib->getValueInit("MemberList"), Impls, Lib->getLoc()); + + Libcall2Impl.clear(); + for (const Record *LibcallImpl : Impls) { + const Record *Libcall = LibcallImpl->getValueAsDef("Provides"); + auto [It, Inserted] = Libcall2Impl.insert({Libcall, LibcallImpl}); + if (!Inserted) + PrintError(Lib, "Libcall " + Libcall->getValueAsString("Name") + + " has more than one Impl"); + } + + llvm::StringToOffsetTable Table( + /*AppendZero=*/true, + /*ClassPrefix=*/"", /*UsePrefixForStorageMember=*/false); + for (const auto *R : AllTargetLibcalls) + Table.GetOrAddStringOffset(getFuncName(R)); + + OS.indent(4) + << "static constexpr char StandardNamesStrTableStorage[] =\n"; + Table.EmitString(OS); + OS << ";\n"; + OS.indent(4) << "StandardNamesStrTable = " + << "llvm::StringTable(StandardNamesStrTableStorage);\n"; + OS.indent(4) << "StandardNamesOffsets = {\n"; + OS.indent(6) << "0, //\n"; + for (const auto *R : AllTargetLibcalls) { + StringRef Str = getFuncName(R); + OS.indent(6) << Table.GetStringOffset(Str) << ", // " << Str << "\n"; + } + OS.indent(4) << "};\n"; + OS.indent(4) << "StandardNamesSizeTable = {\n"; + OS.indent(4) << " 0,\n"; + for (const auto *R : AllTargetLibcalls) + OS.indent(6) << getFuncName(R).size() << ",\n"; + OS.indent(4) << "};\n"; + + OS.indent(4) << "return;\n"; + OS.indent(2) << "}\n"; // end of if (...) } - OS << "};\n"; - OS << "const uint8_t TargetLibraryInfoImpl::StandardNamesSizeTable[" - << NumEl << "] = {\n"; - OS << " 0,\n"; - for (const auto *R : AllTargetLibcalls) - OS.indent(2) << getFuncName(R).size() << ",\n"; - OS << "};\n"; + OS.indent(2) << "return;\n"; + OS << "}\n"; // end of setTargetLibraryLibcallSets() } IfDefEmitter IfDef(OS, "GET_TARGET_LIBRARY_INFO_IMPL_DECL"); - OS << "LLVM_ABI static const llvm::StringTable StandardNamesStrTable;\n"; - OS << "LLVM_ABI static const llvm::StringTable::Offset StandardNamesOffsets[" - << NumEl << "];\n"; - OS << "LLVM_ABI static const uint8_t StandardNamesSizeTable[" << NumEl - << "];\n"; + OS << "LLVM_ABI llvm::StringTable StandardNamesStrTable{\"\\0\"};\n"; + OS << "LLVM_ABI std::array StandardNamesOffsets;\n"; + OS << "LLVM_ABI std::array StandardNamesSizeTable;\n"; } // Since there are much less type signatures then library functions, the type @@ -139,7 +183,6 @@ void TargetLibraryInfoEmitter::emitTargetLibraryInfoSignatureTable( using Signature = std::vector; SequenceToOffsetTable SignatureTable("NoFuncArgType"); auto GetSignature = [](const Record *R) -> Signature { - R = R->getValueAsDef("RTLibcallImpl")->getValueAsDef("Provides"); const auto *Tys = R->getValueAsListInit("ArgumentTypes"); Signature Sig; Sig.reserve(Tys->size() + 1); @@ -173,7 +216,7 @@ void TargetLibraryInfoEmitter::emitTargetLibraryInfoSignatureTable( OS.indent(2) << SignatureTable.get(NoFuncSig) << ", //\n"; for (const auto *R : AllTargetLibcalls) { OS.indent(2) << SignatureTable.get(GetSignature(R)) << ", // " - << R->getName().drop_front(4) << "\n"; + << getEnumName(R) << "\n"; } OS << "};\n"; }