From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] C++-ify typedef hash
Date: Mon, 26 Mar 2018 15:13:00 -0000 [thread overview]
Message-ID: <6ace14da-cf07-4dd4-47a6-037c921eb129@redhat.com> (raw)
In-Reply-To: <20180315215858.15647-1-tom@tromey.com>
Hi Tom,
Just a few remarks below.
On 03/15/2018 09:58 PM, Tom Tromey wrote:
>
> /* Iteratively try the type pretty-printers specified by PRINTERS
> @@ -463,8 +458,7 @@ apply_ext_lang_type_printers (struct ext_lang_type_printers *printers,
> /* Call this after pretty-printing a type to release all memory held
> by PRINTERS. */
At least this comment should be updated -- there's no "PRINTERS"
parameter any longer.
>
> -void
> -free_ext_lang_type_printers (struct ext_lang_type_printers *printers)
> +ext_lang_type_printers::~ext_lang_type_printers ()
> {
- of the contained objects. */
> +
> +class typedef_hash_table
> +{
> +public:
> +
> + /* Create a new typedef-lookup hash table. */
> + typedef_hash_table ();
> +
> + ~typedef_hash_table ();
> +
> + /* Copy a typedef hash. */
> + typedef_hash_table (const typedef_hash_table *);
This method's prototype gave me pause -- is there a reason this
isn't a regular copy ctor?
>
> -void add_template_parameters (struct typedef_hash_table *, struct type *);
> + typedef_hash_table &operator= (const typedef_hash_table &) = delete;
>
> -struct typedef_hash_table *create_typedef_hash (void);
> + /* Add typedefs from T to the hash table TABLE. */
> + void recursively_update (struct type *);
>
> -void free_typedef_hash (struct typedef_hash_table *);
> + /* Add template parameters from T to the typedef hash TABLE. */
> + void add_template_parameters (struct type *t);
>
> -struct cleanup *make_cleanup_free_typedef_hash (struct typedef_hash_table *);
> + /* Look up the type T in the typedef hash table FLAGS. If T
But FLAGS isn't a hash table, right? The original comment said:
/* Look up the type T in the typedef hash table in with FLAGS.
^^^^^^^
I wonder whether that was a typo for "within".
Maybe this could say something about local/global too.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2018-03-26 15:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 21:59 Tom Tromey
2018-03-26 15:13 ` Pedro Alves [this message]
2018-03-27 3:11 ` Tom Tromey
2018-03-27 10:33 ` Pedro Alves
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=6ace14da-cf07-4dd4-47a6-037c921eb129@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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