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 dependent_type_p_r.


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>

	* pt.c (dependent_type_p_r): Use num_parm_types and
	nth_parm_type.

Index: cp/pt.c
===================================================================
--- cp/pt.c	(revision 114740)
+++ cp/pt.c	(working copy)
@@ -12229,13 +12229,15 @@ dependent_type_p_r (tree type)
 	   || TREE_CODE (type) == METHOD_TYPE)
     {
       tree arg_type;
+      int len;
+      int i;
 
       if (dependent_type_p (TREE_TYPE (type)))
 	return true;
-      for (arg_type = TYPE_ARG_TYPES (type);
-	   arg_type;
-	   arg_type = TREE_CHAIN (arg_type))
-	if (dependent_type_p (TREE_VALUE (arg_type)))
+      arg_type = TYPE_ARG_TYPES (type);
+      len = num_parm_types (arg_type);
+      for (i = 0; i < len; i++)
+	if (dependent_type_p (nth_parm_type (arg_type, i)))
 	  return true;
       return false;
     }


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