From: Ian Lance Taylor <iant@google.com>
To: Nathan Froyd <froydnj@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] remove TYPE_ARG_TYPES from godump.c
Date: Fri, 20 May 2011 20:36:00 -0000 [thread overview]
Message-ID: <mcroc2xi9jt.fsf@coign.corp.google.com> (raw)
In-Reply-To: <20110520140139.GB22416@nightcrawler> (Nathan Froyd's message of "Fri, 20 May 2011 10:01:40 -0400")
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
prev parent reply other threads:[~2011-05-20 17:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 14:44 Nathan Froyd
2011-05-20 20:36 ` Ian Lance Taylor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mcroc2xi9jt.fsf@coign.corp.google.com \
--to=iant@google.com \
--cc=froydnj@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).