On Mon, May 5, 2014 at 6:01 PM, Jeff Law <l...@redhat.com> wrote:
> On 05/05/14 02:22, Richard Biener wrote:
>>>
>>>
>>> Also, AIUI, Andrew is looking at introducing concepts of gimple types and
>>> gimple expressions, so "gimple" may no longer imply a *statement*.
>>>
>>> Alternatively, we could make the base class be just "gimple" (which would
>>> be more consistent with the names of the accessor functions).
>>
>>
>> I strongly prefer to name it 'gimple', not 'gimple_stmt'.  Because it's
>> less
>> to type, and because it will make all other types shorter as well.  And
>> because
>> 'gimple' _is_ a stmt right now, so gimple_stmt is redundant.  Same applies
>> to gimple_stmt_with_FOO, just make it gimple_with_FOO.
>>
>> I understand the namespace issue, but we don't have a namespace right now.
>> Also gimple::gimple works just fine, no?
>
> But this approach is going to be inconsistent with Andrew's work, right?
> ISTM we'd end up with something like...
>
> So statements would be "gimple"
> types would be "gimple_type"
> expressions would be "gimple_expr"

Well, I hope that Andrew doesn't do without a namespace (and I still
don't believe in what he tries to achieve without laying proper ground-work
throughout the compiler).  With a namespace gimple we can use
gimple::stmt.

> It's a bit of bikeshedding, but I'd prefer "gimple_stmt".  If you really
> feel strongly about it, I'll go along without objection, but it seems wrong
> to me.

Less typing.  But yes, it's bikeshedding.  Still gimple_stmt is
redundant information in almost all context.  'stmt' was opposed to
elsewhere so we settle on 'gimple' (which is already existing).
IMHO not changing things is the best bikeshedding argument.

>>
>>> There's also the "bargain basement" namespaces approach, where we don't
>>> have an implicit "gimple" namespace, but just *pretend* we do, and rename
>>> the base type to "stmt", with e.g. "gimple_statement_phi" becoming just
>>> "phi". ["gimple_switch" would need to become "switch_", say, to avoid the
>>> reserved word].
>>
>>
>> Ick (for the 'switch' case ... CamelCase anyone? :)).
>
> :-)  Please, no....

Agreed on that, btw.  But switch_ can't be the answer either.  Maybe
swidch (similar do klass) or swjdch.  Or swtch.  I like swtch the best
(similar to stmt).

Richard.

> Jeff

Reply via email to