This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Use num_parm_types, num_artificial_parms_for, and nth_parm_type in synthesize_method.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 9 Jul 2006 19:55:22 -0700
- Subject: [lto] Use num_parm_types, num_artificial_parms_for, and nth_parm_type in synthesize_method.
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-07-10 Kazu Hirata <kazu@codesourcery.com>
* method.c (synthesize_method): Use num_parm_types,
num_artificial_parms_for, and nth_parm_type.
Index: cp/method.c
===================================================================
--- cp/method.c (revision 115288)
+++ cp/method.c (working copy)
@@ -777,8 +777,11 @@ synthesize_method (tree fndecl)
}
else if (DECL_CONSTRUCTOR_P (fndecl))
{
- tree arg_chain = FUNCTION_FIRST_USER_PARMTYPE (fndecl);
- if (arg_chain != void_list_node)
+ tree parm_types = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ int len = num_parm_types (parm_types);
+ int skip = num_artificial_parms_for (fndecl);
+ if (skip + 1 != len
+ || nth_parm_type (parm_types, skip) != void_type_node)
do_build_copy_constructor (fndecl);
else if (TYPE_NEEDS_CONSTRUCTING (current_class_type))
finish_mem_initializers (NULL_TREE);