diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2007-07-18 16:13:09 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2007-07-18 16:13:09 +0000 |
commit | b5d32c25372d1e0604bbd8471d735e46215dbe03 (patch) | |
tree | 2df881b0bf06cd1bc8e30b69d2a519b82a1442ca /gcc/c-common.c | |
parent | c3e4e34df939059960b03bf4a4dc0dcaf548e31b (diff) | |
download | gcc-b5d32c25372d1e0604bbd8471d735e46215dbe03.zip gcc-b5d32c25372d1e0604bbd8471d735e46215dbe03.tar.gz gcc-b5d32c25372d1e0604bbd8471d735e46215dbe03.tar.bz2 |
re PR middle-end/32668 (The type-generic builtins apply default promotions)
PR middle-end/32668
* builtin-attrs.def (ATTR_TYPEGENERIC,
ATTR_CONST_NOTHROW_TYPEGENERIC): New.
* builtins.def (BUILT_IN_ISINF, BUILT_IN_ISNAN,
BUILT_IN_ISGREATER, BUILT_IN_ISGREATEREQUAL, BUILT_IN_ISLESS,
BUILT_IN_ISLESSEQUAL, BUILT_IN_ISLESSGREATER,
BUILT_IN_ISUNORDERED): Use ATTR_CONST_NOTHROW_TYPEGENERIC.
* c-common.c (handle_type_generic_attribute): New.
(c_common_attribute_table): Add "type generic".
* c-typeck.c (convert_arguments): Handle "type generic" functions.
From-SVN: r126723
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index b884be9..c9874d2 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -555,6 +555,7 @@ static tree handle_cleanup_attribute (tree *, tree, tree, int, bool *); static tree handle_warn_unused_result_attribute (tree *, tree, tree, int, bool *); static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); +static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *); static tree handle_alloc_size_attribute (tree *, tree, tree, int, bool *); static void check_function_nonnull (tree, int, tree *); @@ -650,6 +651,10 @@ const struct attribute_spec c_common_attribute_table[] = handle_warn_unused_result_attribute }, { "sentinel", 0, 1, false, true, true, handle_sentinel_attribute }, + /* For internal use (marking of builtins) only. The name contains space + to prevent its usage in source code. */ + { "type generic", 0, 0, false, true, true, + handle_type_generic_attribute }, { "alloc_size", 1, 2, false, true, true, handle_alloc_size_attribute }, { "cold", 0, 0, true, false, false, @@ -6166,6 +6171,19 @@ handle_sentinel_attribute (tree *node, tree name, tree args, return NULL_TREE; } + +/* Handle a "type_generic" attribute. */ + +static tree +handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), + tree ARG_UNUSED (args), int ARG_UNUSED (flags), + bool * ARG_UNUSED (no_add_attrs)) +{ + /* Ensure we have a function type, with no arguments. */ + gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE && ! TYPE_ARG_TYPES (*node)); + + return NULL_TREE; +} /* Check for valid arguments being passed to a function. ATTRS is a list of attributes. There are NARGS arguments in the array |