+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>
PR ada/47163
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,
}
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",
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;
}
+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>
PR c++/48450
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,
}
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);
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;
}
+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>
* lto.c (lto_materialize_function): Don't read and then discard
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)
{
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;
}