Commit dcf0c47e by Nathan Froyd Committed by Nathan Froyd

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
parent 44f370bf
2011-04-08 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/utils.c (handle_sentinel_attribute): Don't use
TYPE_ARG_TYPES
(handle_type_generic_attribute): Likewise.
2011-04-04 Eric Botcazou <ebotcazou@adacore.com> 2011-04-04 Eric Botcazou <ebotcazou@adacore.com>
PR ada/47163 PR ada/47163
......
...@@ -5266,8 +5266,6 @@ static tree ...@@ -5266,8 +5266,6 @@ static tree
handle_sentinel_attribute (tree *node, tree name, tree args, handle_sentinel_attribute (tree *node, tree name, tree args,
int ARG_UNUSED (flags), bool *no_add_attrs) int ARG_UNUSED (flags), bool *no_add_attrs)
{ {
tree params = TYPE_ARG_TYPES (*node);
if (!prototype_p (*node)) if (!prototype_p (*node))
{ {
warning (OPT_Wattributes, warning (OPT_Wattributes,
...@@ -5277,10 +5275,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, ...@@ -5277,10 +5275,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
} }
else else
{ {
while (TREE_CHAIN (params)) if (!stdarg_p (*node))
params = TREE_CHAIN (params);
if (VOID_TYPE_P (TREE_VALUE (params)))
{ {
warning (OPT_Wattributes, warning (OPT_Wattributes,
"%qs attribute only applies to variadic functions", "%qs attribute only applies to variadic functions",
...@@ -5400,17 +5395,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), ...@@ -5400,17 +5395,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
tree ARG_UNUSED (args), int ARG_UNUSED (flags), tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs)) bool * ARG_UNUSED (no_add_attrs))
{ {
tree params;
/* Ensure we have a function type. */ /* Ensure we have a function type. */
gcc_assert (TREE_CODE (*node) == 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. */ /* Ensure we have a variadic function. */
gcc_assert (!params); gcc_assert (!prototype_p (*node) || stdarg_p (*node));
return NULL_TREE; return NULL_TREE;
} }
......
2011-04-08 Nathan Froyd <froydnj@codesourcery.com>
* c-common.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES.
(handle_type_generic_attribute): Likewise.
2011-04-07 Jason Merrill <jason@redhat.com> 2011-04-07 Jason Merrill <jason@redhat.com>
PR c++/48450 PR c++/48450
......
...@@ -7662,8 +7662,6 @@ static tree ...@@ -7662,8 +7662,6 @@ static tree
handle_sentinel_attribute (tree *node, tree name, tree args, handle_sentinel_attribute (tree *node, tree name, tree args,
int ARG_UNUSED (flags), bool *no_add_attrs) int ARG_UNUSED (flags), bool *no_add_attrs)
{ {
tree params = TYPE_ARG_TYPES (*node);
if (!prototype_p (*node)) if (!prototype_p (*node))
{ {
warning (OPT_Wattributes, warning (OPT_Wattributes,
...@@ -7672,10 +7670,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, ...@@ -7672,10 +7670,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
} }
else else
{ {
while (TREE_CHAIN (params)) if (!stdarg_p (*node))
params = TREE_CHAIN (params);
if (VOID_TYPE_P (TREE_VALUE (params)))
{ {
warning (OPT_Wattributes, warning (OPT_Wattributes,
"%qE attribute only applies to variadic functions", name); "%qE attribute only applies to variadic functions", name);
...@@ -7714,17 +7709,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), ...@@ -7714,17 +7709,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
tree ARG_UNUSED (args), int ARG_UNUSED (flags), tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs)) bool * ARG_UNUSED (no_add_attrs))
{ {
tree params;
/* Ensure we have a function type. */ /* Ensure we have a function type. */
gcc_assert (TREE_CODE (*node) == 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. */ /* Ensure we have a variadic function. */
gcc_assert (!params); gcc_assert (!prototype_p (*node) || stdarg_p (*node));
return NULL_TREE; return NULL_TREE;
} }
......
2011-04-08 Nathan Froyd <froydnj@codesourcery.com>
* lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES.
(handle_type_generic_attribute): Likewise.
2011-04-03 Michael Matz <matz@suse.de> 2011-04-03 Michael Matz <matz@suse.de>
* lto.c (lto_materialize_function): Don't read and then discard * lto.c (lto_materialize_function): Don't read and then discard
......
...@@ -373,13 +373,7 @@ handle_sentinel_attribute (tree *node, tree ARG_UNUSED (name), tree args, ...@@ -373,13 +373,7 @@ handle_sentinel_attribute (tree *node, tree ARG_UNUSED (name), tree args,
int ARG_UNUSED (flags), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs)) bool * ARG_UNUSED (no_add_attrs))
{ {
tree params = TYPE_ARG_TYPES (*node); gcc_assert (stdarg_p (*node));
gcc_assert (params);
while (TREE_CHAIN (params))
params = TREE_CHAIN (params);
gcc_assert (!VOID_TYPE_P (TREE_VALUE (params)));
if (args) if (args)
{ {
...@@ -399,17 +393,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), ...@@ -399,17 +393,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
tree ARG_UNUSED (args), int ARG_UNUSED (flags), tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs)) bool * ARG_UNUSED (no_add_attrs))
{ {
tree params;
/* Ensure we have a function type. */ /* Ensure we have a function type. */
gcc_assert (TREE_CODE (*node) == 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. */ /* Ensure we have a variadic function. */
gcc_assert (!params); gcc_assert (!prototype_p (*node) || stdarg_p (*node));
return NULL_TREE; return NULL_TREE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment