public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Michael Matz <matz@suse.de>
Cc: Richard Biener <richard.guenther@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Come up with htab_hash_string_vptr and use string-specific if possible.
Date: Mon, 12 Nov 2018 09:35:00 -0000	[thread overview]
Message-ID: <024539e4-17c7-19af-4d1a-adf8ad4fa9ca@suse.cz> (raw)
In-Reply-To: <alpine.LSU.2.21.1811091326350.21712@wotan.suse.de>

On 11/9/18 2:28 PM, Michael Matz wrote:
> Hi,
> 
> On Thu, 8 Nov 2018, Martin Liška wrote:
> 
>>> That seems better.  But still, why declare this in system.h?  It seems 
>>> hash-table.h seems more appropriate.
>>
>> I need to declare it before I'll poison it. As system.h is included very 
>> early, one can guarantee that there will be no usage before the 
>> poisoning happens.
> 
> Yes but it's also included everywhere, so adding anything to it comes at a 
> cost, and conceptually it simply doesn't belong there.

Agree.

> 
> There's no fundamental reason why we can't poison identifiers in other 
> headers.  Indeed we do in vec.h.  So move the whole thing including 
> poisoning to hash-table.h?

That's not feasible as gcc/gcc/genhooks.c files use the function and
we don't want to include hash-table.h in the generator files.
So second candidate can be gcc/hash-traits.h, but it's also not working:
/home/marxin/Programming/gcc/gcc/hash-traits.h:270:17: error: ‘gt_pointer_operator’ has not been declared
   pch_nx (T &p, gt_pointer_operator op, void *cookie)
                 ^~~~~~~~~~~~~~~~~~~

so we should eventually come up with "hash.h" and include it in many places as there's following usage
in hash-traits.h:

   212  inline hashval_t
   213  string_hash::hash (const char *id)
   214  {
   215    return hash_string (id);
   216  }

So it's question whether it worth doing that?

Martin

> 
> 
> Ciao,
> Michael.
> 

  reply	other threads:[~2018-11-12  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 17:32 Martin Liška
2018-11-02  8:03 ` Richard Biener
2018-11-02  8:10   ` Martin Liška
2018-11-02  9:25     ` Martin Liška
2018-11-05 18:37       ` Michael Matz
2018-11-07  8:54         ` Martin Liška
2018-11-08 13:15           ` Michael Matz
2018-11-08 13:41             ` Martin Liška
2018-11-09 13:28               ` Michael Matz
2018-11-12  9:35                 ` Martin Liška [this message]
2018-11-12 13:43                   ` Michael Matz

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=024539e4-17c7-19af-4d1a-adf8ad4fa9ca@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=matz@suse.de \
    --cc=richard.guenther@gmail.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).