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]

Re: [PATCH] remove TYPE_ARG_TYPES from godump.c


Nathan Froyd <froydnj@codesourcery.com> writes:

> gcc/
> 	* godump.c (go_format_type): Don't use TYPE_ARG_TYPES.

>      case FUNCTION_TYPE:
>        {
> -	tree args;
> +	tree arg_type;
>  	bool is_varargs;
>  	tree result;
> +	function_args_iterator iter;
> +	bool seen_arg = false;
>  
>  	/* Go has no way to write a type which is a function but not a
>  	   pointer to a function.  */
> @@ -754,25 +756,20 @@ go_format_type (struct godump_container *container, tree type,
>  	  }
>  
>  	obstack_1grow (ob, '(');
> -	is_varargs = true;
> -	for (args = TYPE_ARG_TYPES (type);
> -	     args != NULL_TREE;
> -	     args = TREE_CHAIN (args))
> +	is_varargs = stdarg_p (type);
> +	FOREACH_FUNCTION_ARGS (type, arg_type, iter)

Please move the initialization of seen_arg to down just before the
loop.  I find it harder to have to look back up to the definition to
verify that the loop runs correctly.

This is OK with that change.

Thanks.

Ian


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