DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
false, false, false, ATTRS, true)
-/* A fallback builtin is a builtin (like __builtin_puts) that falls
- back to the corresponding library function if necessary -- but
- for which we should not introduce the non-`__builtin' variant of
- the name. */
-#undef DEF_FALLBACK_BUILTIN
-#define DEF_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- false, true, false, ATTRS, true)
-
-/* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
- is specified by ANSI/ISO C. So, when we're being fully conformant
- we ignore the version of these builtins that does not begin with
- __builtin. */
-#undef DEF_EXT_FALLBACK_BUILTIN
-#define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- false, true, true, ATTRS, true)
-
/* A library builtin (like __builtin_strchr) is a builtin equivalent
of an ANSI/ISO standard library function. In addition to the
`__builtin' version, we will create an ordinary version (e.g,
BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
ATTR_CONST_NOTHROW_LIST)
-/* The system prototypes for `bzero', 'bcopy' and `bcmp' functions
- have many variations, so don't specify parameters to avoid
- conflicts. The expand_* functions check the argument types anyway.
- In addition, these functions have traditionally accepted NULL
- pointers when the length parameter is zero, so don't apply
- attribute "nonnull". */
-DEF_BUILTIN (BUILT_IN_BZERO,
- "__builtin_bzero",
- BUILT_IN_NORMAL,
- BT_FN_VOID_PTR_SIZE,
- BT_FN_VOID_VAR,
- true, true, true,
- ATTR_NOTHROW_LIST, false)
-DEF_BUILTIN (BUILT_IN_BCOPY,
- "__builtin_bcopy",
- BUILT_IN_NORMAL,
- BT_FN_VOID_CONST_PTR_PTR_SIZE,
- BT_FN_VOID_VAR,
- true, true, true,
- ATTR_NOTHROW_LIST, false)
-DEF_BUILTIN (BUILT_IN_BCMP,
- "__builtin_bcmp",
- BUILT_IN_NORMAL,
- BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
- BT_FN_INT_VAR,
- true, true, true,
- ATTR_PURE_NOTHROW_LIST, false)
+/* These functions have traditionally accepted NULL pointers when the
+ length parameter is zero, so don't apply attribute "nonnull". */
+DEF_EXT_LIB_BUILTIN(BUILT_IN_BZERO,
+ "__builtin_bzero",
+ BT_FN_VOID_PTR_SIZE,
+ ATTR_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_BCOPY,
+ "__builtin_bcopy",
+ BT_FN_VOID_CONST_PTR_PTR_SIZE,
+ ATTR_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_BCMP,
+ "__builtin_bcmp",
+ BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
+ ATTR_PURE_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN(BUILT_IN_FFS,
"__builtin_ffs",
regular style declaration since we had to use void* instead of
FILE* in the __builtin_ prototype supplied here. */
-DEF_FALLBACK_BUILTIN(BUILT_IN_FPUTC,
- "__builtin_fputc",
- BT_FN_INT_INT_PTR,
- ATTR_NOTHROW_NONNULL_2)
-DEF_BUILTIN (BUILT_IN_FPUTS,
- "__builtin_fputs",
- BUILT_IN_NORMAL,
- BT_FN_INT_CONST_STRING_PTR,
- BT_FN_INT_VAR,
- true, true, false, ATTR_NOTHROW_NONNULL_1_2, true)
-DEF_FALLBACK_BUILTIN(BUILT_IN_FWRITE,
- "__builtin_fwrite",
- BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
- ATTR_NOTHROW_NONNULL_1_4)
+DEF_LIB_BUILTIN(BUILT_IN_FPUTC,
+ "__builtin_fputc",
+ BT_FN_INT_INT_PTR,
+ ATTR_NOTHROW_NONNULL_2)
+DEF_LIB_BUILTIN(BUILT_IN_FPUTS,
+ "__builtin_fputs",
+ BT_FN_INT_CONST_STRING_PTR,
+ ATTR_NOTHROW_NONNULL_1_2)
+DEF_LIB_BUILTIN(BUILT_IN_FWRITE,
+ "__builtin_fwrite",
+ BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
+ ATTR_NOTHROW_NONNULL_1_4)
DEF_LIB_BUILTIN(BUILT_IN_FPRINTF,
"__builtin_fprintf",
BT_FN_INT_PTR_CONST_STRING_VAR,
/* stdio unlocked builtins (without FILE *). */
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
- "__builtin_putchar_unlocked",
- BT_FN_INT_INT, ATTR_NOTHROW_LIST)
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
- "__builtin_puts_unlocked",
- BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
+ "__builtin_putchar_unlocked",
+ BT_FN_INT_INT,
+ ATTR_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
+ "__builtin_puts_unlocked",
+ BT_FN_INT_CONST_STRING,
+ ATTR_NOTHROW_NONNULL_1)
DEF_EXT_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
"__builtin_printf_unlocked",
BT_FN_INT_CONST_STRING_VAR,
regular style declaration since we had to use void* instead of
FILE* in the __builtin_ prototype supplied here. */
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
- "__builtin_fputc_unlocked",
- BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2)
-DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
- "__builtin_fputs_unlocked",
- BUILT_IN_NORMAL,
- BT_FN_INT_CONST_STRING_PTR,
- BT_FN_INT_VAR,
- true, true, true, ATTR_NOTHROW_NONNULL_1_2, true)
-DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
- "__builtin_fwrite_unlocked",
- BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
- ATTR_NOTHROW_NONNULL_1_4)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
+ "__builtin_fputc_unlocked",
+ BT_FN_INT_INT_PTR,
+ ATTR_NOTHROW_NONNULL_2)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_FPUTS_UNLOCKED,
+ "__builtin_fputs_unlocked",
+ BT_FN_INT_CONST_STRING_PTR,
+ ATTR_NOTHROW_NONNULL_1_2)
+DEF_EXT_LIB_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
+ "__builtin_fwrite_unlocked",
+ BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
+ ATTR_NOTHROW_NONNULL_1_4)
DEF_EXT_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
"__builtin_fprintf_unlocked",
BT_FN_INT_PTR_CONST_STRING_VAR,