From: Nathan Froyd Date: Fri, 8 Apr 2011 17:05:23 +0000 (+0000) Subject: utils.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dcf0c47e8ddf338b9d3f02f9bee3265c1b4138d1;p=gcc.git utils.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES gcc/ada/ * gcc-interface/utils.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES (handle_type_generic_attribute): Likewise. gcc/c-family/ * c-common.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. (handle_type_generic_attribute): Likewise. gcc/lto/ * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. (handle_type_generic_attribute): Likewise. From-SVN: r172200 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 033c211fde2..155256e068c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2011-04-08 Nathan Froyd + + * gcc-interface/utils.c (handle_sentinel_attribute): Don't use + TYPE_ARG_TYPES + (handle_type_generic_attribute): Likewise. + 2011-04-04 Eric Botcazou PR ada/47163 diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index dc743740cfe..8a787893074 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -5266,8 +5266,6 @@ static tree handle_sentinel_attribute (tree *node, tree name, tree args, int ARG_UNUSED (flags), bool *no_add_attrs) { - tree params = TYPE_ARG_TYPES (*node); - if (!prototype_p (*node)) { warning (OPT_Wattributes, @@ -5277,10 +5275,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, } else { - while (TREE_CHAIN (params)) - params = TREE_CHAIN (params); - - if (VOID_TYPE_P (TREE_VALUE (params))) + if (!stdarg_p (*node)) { warning (OPT_Wattributes, "%qs attribute only applies to variadic functions", @@ -5400,17 +5395,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool * ARG_UNUSED (no_add_attrs)) { - tree params; - /* Ensure we have a function type. */ gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE); - params = TYPE_ARG_TYPES (*node); - while (params && ! VOID_TYPE_P (TREE_VALUE (params))) - params = TREE_CHAIN (params); - /* Ensure we have a variadic function. */ - gcc_assert (!params); + gcc_assert (!prototype_p (*node) || stdarg_p (*node)); return NULL_TREE; } diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b859db6180e..af66edaf103 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2011-04-08 Nathan Froyd + + * c-common.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. + (handle_type_generic_attribute): Likewise. + 2011-04-07 Jason Merrill PR c++/48450 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index e0acfea5ca8..63444b8d129 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7662,8 +7662,6 @@ static tree handle_sentinel_attribute (tree *node, tree name, tree args, int ARG_UNUSED (flags), bool *no_add_attrs) { - tree params = TYPE_ARG_TYPES (*node); - if (!prototype_p (*node)) { warning (OPT_Wattributes, @@ -7672,10 +7670,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, } else { - while (TREE_CHAIN (params)) - params = TREE_CHAIN (params); - - if (VOID_TYPE_P (TREE_VALUE (params))) + if (!stdarg_p (*node)) { warning (OPT_Wattributes, "%qE attribute only applies to variadic functions", name); @@ -7714,17 +7709,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool * ARG_UNUSED (no_add_attrs)) { - tree params; - /* Ensure we have a function type. */ gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE); - params = TYPE_ARG_TYPES (*node); - while (params && ! VOID_TYPE_P (TREE_VALUE (params))) - params = TREE_CHAIN (params); - /* Ensure we have a variadic function. */ - gcc_assert (!params); + gcc_assert (!prototype_p (*node) || stdarg_p (*node)); return NULL_TREE; } diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 00f695f00ee..56bf3f5b4e1 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2011-04-08 Nathan Froyd + + * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. + (handle_type_generic_attribute): Likewise. + 2011-04-03 Michael Matz * lto.c (lto_materialize_function): Don't read and then discard diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 535fc584f90..c65d916c14c 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -373,13 +373,7 @@ handle_sentinel_attribute (tree *node, tree ARG_UNUSED (name), tree args, int ARG_UNUSED (flags), bool * ARG_UNUSED (no_add_attrs)) { - tree params = TYPE_ARG_TYPES (*node); - gcc_assert (params); - - while (TREE_CHAIN (params)) - params = TREE_CHAIN (params); - - gcc_assert (!VOID_TYPE_P (TREE_VALUE (params))); + gcc_assert (stdarg_p (*node)); if (args) { @@ -399,17 +393,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool * ARG_UNUSED (no_add_attrs)) { - tree params; - /* Ensure we have a function type. */ gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE); - params = TYPE_ARG_TYPES (*node); - while (params && ! VOID_TYPE_P (TREE_VALUE (params))) - params = TREE_CHAIN (params); - /* Ensure we have a variadic function. */ - gcc_assert (!params); + gcc_assert (!prototype_p (*node) || stdarg_p (*node)); return NULL_TREE; }