This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Hash table iterators.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Lawrence Crowl <crowl at googlers dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>
- Date: Thu, 22 Nov 2012 13:06:46 -0600
- Subject: Re: Hash table iterators.
- References: <CAGqM8faBBmZx9D62kUSHxCOCeP1TO2YzrA652Ti8rmZ=iUOpjg@mail.gmail.com> <CAGqM8fb6jQVZqbX7b9zPutvoea8-hQAQLDTg2XODRr6ey_Qw1A@mail.gmail.com>
On Thu, Nov 22, 2012 at 12:18 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> I have found that tree-flow.h implements iteration over htab_t,
> while there is no current facility to do that with hash_table.
> Unfortunately, the specific form does not match the standard C++
> approach to iterators. We have several choices.
>
> (1) Ignore the problem and leave all such tables as htab_t.
>
> (2) Write new hash_table iteration functions to match the form of
> the existing GCC macro/function approach.
>
> (3) Write new hash_table iteration functions to match the form used
> by the C++ standard. This approach would entail modifying the loops.
>
> Diego and I have a preference for (3). What do you prefer?
We have to look for the long term shape of the source code. From that
perspective, the choice is simple: (3).
-- Gaby