This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hash table iterators.


On Fri, Nov 23, 2012 at 5:15 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> On 11/22/2012 01:18 PM, Lawrence Crowl 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?
>
>
> I don't like (1) for sure.
>
> Before deciding a preference  between (2) and (3), what are the actual
> differences?   ie, is (2) doing something practical that (3) has to bend
> over for, or is (3)'s format better but wasn't practical before?  is (2)
> otherwise useful going forward?

I prefer (2) with internally using (3).  I have such patch for the loop iterator
around (that takes care of disposing of the iterator via a destructor - so
no longer a need for the fancy BREAK_FROM_XXX stuff).

Richard.

> Andrew
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]