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] Use num_parm_types and nth_parm_type in variably_modified_type_p.


Hi,

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

Kazu Hirata

2006-07-20  Kazu Hirata  <kazu@codesourcery.com>

	* tree.c (variably_modified_type_p): Use num_parm_types and
	nth_parm_type.

Index: tree.c
===================================================================
--- tree.c	(revision 115583)
+++ tree.c	(working copy)
@@ -5700,6 +5700,9 @@ bool
 variably_modified_type_p (tree type, tree fn)
 {
   tree t;
+  tree parm_types;
+  int len;
+  int i;
 
 /* Test if T is either variable (if FN is zero) or an expression containing
    a variable in FN.  */
@@ -5732,10 +5735,12 @@ variably_modified_type_p (tree type, tre
       if (variably_modified_type_p (TREE_TYPE (type), fn))
 	  return true;
 
-      for (t = TYPE_ARG_TYPES (type);
-	   t && t != void_list_node;
-	   t = TREE_CHAIN (t))
-	if (variably_modified_type_p (TREE_VALUE (t), fn))
+      parm_types = TYPE_ARG_TYPES (type);
+      len = num_parm_types (parm_types);
+      if (len && nth_parm_type (parm_types, len - 1))
+	len--;
+      for (i = 0; i < len; i++)
+	if (variably_modified_type_p (nth_parm_type (parm_types, i), fn))
 	  return true;
       break;
 


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