[PATCH 00/89] Compile-time gimple-checking
Jeff Law
law@redhat.com
Wed Apr 30 21:40:00 GMT 2014
On 04/23/14 08:32, Richard Biener wrote:
>> Also I see you introduce a const_FOO class with every FOO one.
>> I wonder whether, now that we have C++, can address const-correctness
>> in a less awkward way than with a typedef. Can you try to go back
>> in time and see why we did with that in the first place? ISTR that
>> it was "oh, if we were only using C++ we wouldn't need to jump through
>> that hoop".
>
> To followup myself here, it's because 'tree' is a typedef to a pointer
> and thus 'const tree' is different from 'const tree_node *'.
Right.
>
> Not sure why we re-introduced the 'mistake' of making 'tree' a pointer
> when we introduced 'gimple'. If we were to make 'gimple' the class
> type itself we can use gimple *, const gimple * and also const gimple &
> (when a NULL pointer is not expected).
It wasn't ever really discussed to the best of my recollection.
>
> Anyway, gazillion new typedefs are ugly :/ (typedefs are ugly)
Yea, can't argue with that. However, do we want to ask David to fix up
the gimple vs gimple * vs const gimple * vs const gimple & as a
prerequisite for this patchset or are you comfortable going forward with
the patchset, then researching if there's a cleaner way to handle the
const/typedef issues?
jeff
More information about the Gcc-patches
mailing list