This is the mail archive of the gcc-patches@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: [RFC] First steps towards segregating types.


On Tue, Nov 25, 2014 at 2:06 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Mon, 24 Nov 2014, Richard Biener wrote:
>
>> > TREE_LIST should die (with the typical replacement being vec<something>);
>> > most lists do not need all the overhead of individually allocated objects
>> > with (code, flags, type, chain, value, purpose).  Probably TREE_VEC too.
>>
>> Note that there is nothing wrong with TREE_LIST or TREE_VEC if
>> they were based off tree_base only.  That they inherit from
>> tree_common is the bug to fix - either by not using TREE_LIST or
>> TREE_VEC from the users that use fields from tree_common or
>> tree_typed or by adjusting those users to not need those fields.
>
> Even inheriting from tree_base, typically lists don't need code (because
> you know statically that something is a list) or flags.  And because
> generally something is statically a list or not a list, there is no
> particular benefit from sharing the static type of tree, and better
> compile-time checking if there is no such common base class for list and
> other objects at all.
>
> (Identifiers are another case that doesn't generally benefit from having a
> common static type of tree.)

All true - but 'tree's were built on the premise that everything is a tree.
An incremental change is to make that sane - removing bits out of
the tree space is also possible (though please not by a wart like
a TYPE_REF tree node ...)

Richard.

>
> --
> Joseph S. Myers
> joseph@codesourcery.com


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