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


Hi,

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

Kazu Hirata

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

	* decl.c (grokdeclarator): Use num_parm_types and
	nth_parm_type.

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 114997)
+++ cp/decl.c	(working copy)
@@ -7988,11 +7988,13 @@ grokdeclarator (const cp_declarator *dec
   if (type == typedef_type && TREE_CODE (type) == FUNCTION_TYPE)
     {
       tree decls = NULL_TREE;
-      tree args;
+      tree parm_types = TYPE_ARG_TYPES (type);
+      int len = num_parm_types (parm_types);
+      int i;
 
-      for (args = TYPE_ARG_TYPES (type); args; args = TREE_CHAIN (args))
+      for (i = 0; i < len; i++)
 	{
-	  tree decl = cp_build_parm_decl (NULL_TREE, TREE_VALUE (args));
+	  tree decl = cp_build_parm_decl (NULL_TREE, nth_parm_type (parm_types, i));
 
 	  TREE_CHAIN (decl) = decls;
 	  decls = decl;


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