[lto] Use num_parm_types and nth_parm_type in varargs_function_p.
Kazu Hirata
kazu@codesourcery.com
Mon Jul 3 05:46:00 GMT 2006
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-07-03 Kazu Hirata <kazu@codesourcery.com>
* tree.c (varargs_function_p): Use num_parm_types and
nth_parm_type in varargs_function_p.
Index: cp/tree.c
===================================================================
--- cp/tree.c (revision 115070)
+++ cp/tree.c (working copy)
@@ -1630,10 +1630,8 @@ int
varargs_function_p (tree function)
{
tree parm = TYPE_ARG_TYPES (TREE_TYPE (function));
- for (; parm; parm = TREE_CHAIN (parm))
- if (TREE_VALUE (parm) == void_type_node)
- return 0;
- return 1;
+ int len = num_parm_types (parm);
+ return (!len || nth_parm_type (parm, len - 1) != void_type_node);
}
/* Returns 1 if decl is a member of a class. */
More information about the Gcc-patches
mailing list