[lto] Use num_parm_types and nth_parm_type in type_num_arguments.
Kazu Hirata
kazu@codesourcery.com
Sat Jul 15 17:15:00 GMT 2006
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-07-15 Kazu Hirata <kazu@codesourcery.com>
* tree.c (type_num_arguments): Use num_parm_types and
nth_parm_type.
Index: tree.c
===================================================================
*** tree.c (revision 115362)
--- tree.c (working copy)
***************
*** 4341,4358 ****
int
type_num_arguments (tree type)
{
! int i = 0;
! tree t;
! for (t = TYPE_ARG_TYPES (type); t; t = TREE_CHAIN (t))
! /* If the function does not take a variable number of arguments,
! the last element in the list will have type `void'. */
! if (VOID_TYPE_P (TREE_VALUE (t)))
! break;
! else
! ++i;
! return i;
}
/* Nonzero if integer constants T1 and T2
--- 4341,4353 ----
int
type_num_arguments (tree type)
{
! tree parm_types = TYPE_ARG_TYPES (type);
! int len = num_parm_types (parm_types);
! if (len && VOID_TYPE_P (nth_parm_type (parm_types, len - 1)))
! len--;
! return len;
}
/* Nonzero if integer constants T1 and T2
More information about the Gcc-patches
mailing list