This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Use num_parm_types and nth_parm_type in no_linkage_check.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 29 Jun 2006 09:04:24 -0700
- Subject: [lto] Use num_parm_types and nth_parm_type in no_linkage_check.
Hi,
Attached is a patch to use num_parm_types and nth_parm_type in
no_linkage_check.
The only notable point is that this patch yanks out the check for
void_type_node.
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-06-29 Kazu Hirata <kazu@codesourcery.com>
* tree.c (no_linkage_check): Use num_parm_types and
nth_parm_type.
Index: cp/tree.c
===================================================================
*** cp/tree.c (revision 115049)
--- cp/tree.c (working copy)
*************** no_linkage_check (tree t, bool relaxed_p
*** 1112,1123 ****
/* Fall through. */
case FUNCTION_TYPE:
{
! tree parm;
! for (parm = TYPE_ARG_TYPES (t);
! parm && parm != void_list_node;
! parm = TREE_CHAIN (parm))
{
! r = no_linkage_check (TREE_VALUE (parm), relaxed_p);
if (r)
return r;
}
--- 1112,1130 ----
/* Fall through. */
case FUNCTION_TYPE:
{
! tree parm_types = TYPE_ARG_TYPES (t);
! int len = num_parm_types (parm_types);
! int i;
!
! if (len
! && nth_parm_type (parm_types, len - 1) == void_type_node)
! len--;
!
! for (i = 0; i < len; i++)
{
! tree type = nth_parm_type (parm_types, i);
!
! r = no_linkage_check (type, relaxed_p);
if (r)
return r;
}