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


Hi,

Attached is a patch to use num_parm_types and nth_parm_type in
build_operator_new_call.

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

Kazu Hirata

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

	* call.c (build_operator_new_call): Use num_parm_types and
	nth_parm_type.

Index: cp/call.c
===================================================================
--- cp/call.c	(revision 114740)
+++ cp/call.c	(working copy)
@@ -2904,12 +2904,11 @@ build_operator_new_call (tree fnname, tr
 	   tree arg_types;
 
 	   arg_types = TYPE_ARG_TYPES (TREE_TYPE (cand->fn));
-	   /* Skip the size_t parameter.  */
-	   arg_types = TREE_CHAIN (arg_types);
-	   /* Check the remaining parameters (if any).  */
-	   if (arg_types
-	       && TREE_CHAIN (arg_types) == void_list_node
-	       && same_type_p (TREE_VALUE (arg_types),
+	   /* Check the parameters (if any) after the size_t
+	      parameter.  */
+	   if (num_parm_types (arg_types) == 3
+	       && nth_parm_type (arg_types, 2) == void_type_node
+	       && same_type_p (nth_parm_type (arg_types, 1),
 			       ptr_type_node))
 	     use_cookie = false;
 	 }


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