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.) -- Joseph S. Myers jos...@codesourcery.com