This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] Stop using TREE_CHAIN on TYPE_ARG_TYPES in locate_copy.


Hi,

Tested on x86_64-pc-linux-gnu.  Committed to the LTO branch as
obvious.

Kazu Hirata

2006-06-24  Kazu Hirata  <kazu@codesourcery.com>

	* method.c (locate_copy): Use num_parm_types,
	nth_parm_type, and num_artificial_parms_for.

Index: cp/method.c
===================================================================
--- cp/method.c	(revision 114740)
+++ cp/method.c	(working copy)
@@ -931,17 +931,19 @@ locate_copy (tree type, void *client_)
     {
       tree fn = OVL_CURRENT (fns);
       tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
+      int len = num_parm_types (parms);
       tree decls = DECL_ARGUMENTS (DECL_FUNCTION_TEMPLATE_P (fn)
 				   ? DECL_TEMPLATE_RESULT (fn) : fn);
       tree src_type;
       int excess;
       int quals;
+      int skip = 0;
 
-      parms = skip_artificial_parms_for (fn, parms);
-      if (!parms)
+      skip = num_artificial_parms_for (fn);
+      if (skip >= len)
 	continue;
       decls = skip_artificial_parms_for (fn, decls);
-      src_type = non_reference (TREE_VALUE (parms));
+      src_type = non_reference (nth_parm_type (parms, skip));
       if (!same_type_ignoring_top_level_qualifiers_p (src_type, type))
 	continue;
       if (!sufficient_parms_p (TREE_CHAIN (decls)))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]