public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Diego Novillo <dnovillo@google.com>
To: Lawrence Crowl <crowl@google.com>
Cc: nathan@codesourcery.com, gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [cxx-conversion] Add Record Builder Class
Date: Wed, 13 Feb 2013 19:42:00 -0000	[thread overview]
Message-ID: <CAD_=9DQdA0caDKEv6wtsLmMpPTFnLoapn5hhezNawuzRaONwGQ@mail.gmail.com> (raw)
In-Reply-To: <CAGqM8fY3g+NfCVNg=zY2VRZ2igeXaatPK+Gi9yktPVvEtmtvMQ@mail.gmail.com>

On Tue, Feb 12, 2013 at 2:47 PM, Lawrence Crowl <crowl@google.com> wrote:

> @@ -182,24 +163,9 @@ default_emutls_var_init (tree to, tree d
>  static tree
>  get_emutls_object_type (void)
>  {
> -  tree type, type_name, field;
> -
> -  type = emutls_object_type;
> -  if (type)
> -    return type;
> -
> -  emutls_object_type = type = lang_hooks.types.make_type (RECORD_TYPE);
> -  type_name = NULL;
> -  field = targetm.emutls.var_fields (type, &type_name);
> -  if (!type_name)
> -    type_name = get_identifier ("__emutls_object");
> -  type_name = build_decl (UNKNOWN_LOCATION,
> -                         TYPE_DECL, type_name, type);
> -  TYPE_NAME (type) = type_name;
> -  TYPE_FIELDS (type) = field;
> -  layout_type (type);
> -
> -  return type;
> +  if (!emutls_object_type)
> +    emutls_object_type = targetm.emutls.object_type ();
> +  return emutls_object_type;

Hm, this does not look like an idempotent change.   Where did I get lost?

===================================================================
> --- gcc/coverage.c      (revision 195904)
> +++ gcc/coverage.c      (working copy)
> @@ -121,8 +121,8 @@ static const char *const ctr_names[GCOV_
>  /* Forward declarations.  */
>  static void read_counts_file (void);
>  static tree build_var (tree, tree, int);
> -static void build_fn_info_type (tree, unsigned, tree);
> -static void build_info_type (tree, tree);
> +static tree build_fn_info_type (unsigned, tree);
> +static tree build_info_type (record_builder &, tree);

I don't really like unnecessary forward declarations.  But I guess
it's OK, since you are replacing existing ones.


> -static void
> -build_fn_info_type (tree type, unsigned counters, tree gcov_info_type)
> +static tree
> +build_fn_info_type (unsigned counters, tree gcov_info_type)

So, here you are changing the signature because the caller used to
create an empty record and now it doesn't need to?  We are going to be
creating it in the constructor, right?


Diego.

  reply	other threads:[~2013-02-13 19:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20130209065835.F0DCF12084A@jade.mtv.corp.google.com>
2013-02-12 19:47 ` Lawrence Crowl
2013-02-13 19:42   ` Diego Novillo [this message]
2013-02-13 20:02     ` Lawrence Crowl
2013-02-13 20:08       ` Diego Novillo
2013-02-13 22:06         ` Lawrence Crowl
2013-02-14  9:26   ` Richard Biener
2013-02-14 11:56     ` Diego Novillo
2013-02-14 12:53       ` Richard Biener
2013-02-14 13:01         ` Diego Novillo
2013-02-14 13:07           ` Richard Biener
2013-02-14 13:41             ` Diego Novillo
2013-02-14 19:44     ` Lawrence Crowl
2013-02-15  9:04       ` Richard Biener
2013-02-15 14:21         ` Gabriel Dos Reis
2013-02-18  9:02   ` Nathan Sidwell

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='CAD_=9DQdA0caDKEv6wtsLmMpPTFnLoapn5hhezNawuzRaONwGQ@mail.gmail.com' \
    --to=dnovillo@google.com \
    --cc=crowl@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@codesourcery.com \
    /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).