[lto] Use num_parm_types and nth_parm_type in check_call.

Kazu Hirata kazu@codesourcery.com
Sat Jul 15 05:19:00 GMT 2006


Hi,

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

Kazu Hirata

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

	* ipa-type-escape.c (check_call): Use num_parm_types and
	nth_parm_type.

Index: ipa-type-escape.c
===================================================================
--- ipa-type-escape.c	(revision 115362)
+++ ipa-type-escape.c	(working copy)
@@ -1036,15 +1036,20 @@ check_call (tree call_expr) 
 	 parameters.  */
       if (TYPE_ARG_TYPES (TREE_TYPE (callee_t)))
 	{
-	  for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)),
-		 operand = first_call_expr_arg (call_expr, &iter);
-	       arg_type && TREE_VALUE (arg_type) != void_type_node;
-	       arg_type = TREE_CHAIN (arg_type),
-		 operand = next_call_expr_arg (&iter))
+	  tree parm_types = TYPE_ARG_TYPES (TREE_TYPE (callee_t));
+	  int len = num_parm_types (parm_types);
+	  int i;
+
+	  if (len && nth_parm_type (parm_types, len - 1) == void_type_node)
+	    len--;
+
+	  for (i = 0, operand = first_call_expr_arg (call_expr, &iter);
+	       i < len;
+	       i++, operand = next_call_expr_arg (&iter))
 	    {
 	      if (operand)
 		{
-		  last_arg_type = TREE_VALUE(arg_type);
+		  last_arg_type = nth_parm_type (parm_types, i);
 		  check_cast (last_arg_type, operand);
 		}
 	      else 



More information about the Gcc-patches mailing list