diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-06 00:16:44 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-06 00:16:44 +0000 |
commit | 8fe4a26678bae0d5114f7118c79849a39c56cf5c (patch) | |
tree | da467fb72d54d71cd83e12f6ba76c83be6c4cb53 /gcc/builtin-attrs.def | |
parent | eb68f168411bf5e6e13ff38e3346c4e96a0850b6 (diff) | |
download | gcc-8fe4a26678bae0d5114f7118c79849a39c56cf5c.tar.gz |
PR c++/7099
* builtin-attrs.def: Define new attribute lists for use in
builtins.def.
* builtins.def [DEF_BUILTIN]: Modify to take an additional
ATTRS argument, an enumerated value defined in builtin-attrs.def
that represents the attribute list for the builtins. Modify
all builtin functions to pass an appropriate attribute list.
Specify "abort", "exit", "_exit" and "_Exit" builtins here with
their required noreturn attributes.
* tree.h (enum_builtin_function): Ignore the additional parameter
to DEF_BUILTIN.
* builtins.c (built_in_names): Likewise.
* c-common.c: (builtin_function_2): Replace the "int noreturn_p"
argument with a tree representing the functions attribute list.
Pass this "attrs" argument to builtin_function. No longer handle
the noreturn_p processing manually.
(built_in_attributes): Move the definitions from builtin-attrs.def
before c_common_nodes_and_builtins.
(c_common_nodes_and_builtins): Handle the new ATTRS parameter in
DEF_BUILTIN, passing it to both builtin_function and the changed
builtin_function_2.
* doc/extend.texi: Document __builtin_abort, __builtin_exit,
__builtin__exit and __builtin__Exit.
* java/builtins.c (initialize_builtins): Ignore the additional
parameter to DEF_BUILTIN. Handle more C/C++ specific junk in
the builtins.def file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55276 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtin-attrs.def')
-rw-r--r-- | gcc/builtin-attrs.def | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def index 56081d1cc51..b307151d508 100644 --- a/gcc/builtin-attrs.def +++ b/gcc/builtin-attrs.def @@ -77,15 +77,30 @@ DEF_LIST_INT_INT (3,0) DEF_LIST_INT_INT (3,4) #undef DEF_LIST_INT_INT +/* Construct tress for identifiers. */ +DEF_ATTR_IDENT (ATTR_CONST, "const") +DEF_ATTR_IDENT (ATTR_FORMAT, "format") +DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") +DEF_ATTR_IDENT (ATTR_MALLOC, "malloc") +DEF_ATTR_IDENT (ATTR_NONNULL, "nonnull") +DEF_ATTR_IDENT (ATTR_NORETURN, "noreturn") +DEF_ATTR_IDENT (ATTR_NOTHROW, "nothrow") DEF_ATTR_IDENT (ATTR_PRINTF, "printf") +DEF_ATTR_IDENT (ATTR_PURE, "pure") DEF_ATTR_IDENT (ATTR_SCANF, "scanf") -DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime") DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon") +DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime") -DEF_ATTR_IDENT (ATTR_FORMAT, "format") -DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") +DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LIST, ATTR_NOTHROW, ATTR_NULL, ATTR_NULL) -DEF_ATTR_IDENT (ATTR_NONNULL, "nonnull") +DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LIST, ATTR_CONST, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LIST, ATTR_NORETURN, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_LIST, ATTR_MALLOC, \ + ATTR_NULL, ATTR_NOTHROW_LIST) DEF_ATTR_TREE_LIST (ATTR_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, ATTR_NULL) DEF_ATTR_TREE_LIST (ATTR_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, ATTR_NULL) @@ -132,17 +147,8 @@ DEF_FORMAT_ARG_ATTRIBUTE(2) -ffreestanding, these default attributes are disabled, and must be specified manually if desired. */ -/* __builtin functions should be checked unconditionally, even with - -ffreestanding. */ -DEF_FN_ATTR_IDENT (__builtin_printf, ATTR_FORMAT_PRINTF_1_2, true) -DEF_FN_ATTR_IDENT (__builtin_fprintf, ATTR_FORMAT_PRINTF_2_3, true) -DEF_FN_ATTR_IDENT (__builtin_printf_unlocked, ATTR_FORMAT_PRINTF_1_2, true) -DEF_FN_ATTR_IDENT (__builtin_fprintf_unlocked, ATTR_FORMAT_PRINTF_2_3, true) - /* Functions from ISO/IEC 9899:1990. */ #define DEF_C89_ATTR(NAME, ATTRS) DEF_FN_ATTR_IDENT (NAME, ATTRS, flag_hosted) -DEF_C89_ATTR (printf, ATTR_FORMAT_PRINTF_1_2) -DEF_C89_ATTR (fprintf, ATTR_FORMAT_PRINTF_2_3) DEF_C89_ATTR (sprintf, ATTR_FORMAT_PRINTF_2_3) DEF_C89_ATTR (scanf, ATTR_FORMAT_SCANF_1_2) DEF_C89_ATTR (fscanf, ATTR_FORMAT_SCANF_2_3) @@ -175,8 +181,5 @@ DEF_EXT_ATTR (dgettext, ATTR_FORMAT_ARG_2) DEF_EXT_ATTR (dcgettext, ATTR_FORMAT_ARG_2) /* X/Open strfmon function. */ DEF_EXT_ATTR (strfmon, ATTR_FORMAT_STRFMON_3_4) -/* Glibc thread-unsafe stdio functions. */ -DEF_EXT_ATTR (printf_unlocked, ATTR_FORMAT_PRINTF_1_2) -DEF_EXT_ATTR (fprintf_unlocked, ATTR_FORMAT_PRINTF_2_3) #undef DEF_EXT_ATTR #undef DEF_FN_ATTR_IDENT |