On Fri, Nov 21, 2014 at 1:48 PM, Andrew MacLeod <amacl...@redhat.com> wrote:

> 1 - introduce a TYPE_REF tree node, which is effectively just a 'typed' tree
> node, and the TREE_TYPE() field of a TYPE_REF node would point to the type
> node.  Any routines which utilize a TYPE node in a tree list would have to
> be modified to make use of this new TYPE_REF node to refer to the type.
>
> 2 - change the field (list->value in this case) to be a tagged union of {
> tree tree_value, tree_type_ptr type_value } and use a bit in the base to
> flag which kind of value it is. This would be compatible with GTY, and would
> require changing routines and algorithms to check the bit and use the right
> field.

Seems to me that option 2 would also help against code that blindly
looks at TREE_VALUE and assumes it to be a tree. Wouldn't that make
initial implementation a bit more challenging?

Option 1 does seem easier, but I kind of like the forcing of rvalues
that option 2 provides.

Also liking option 1. The final change to the final type should be
simpler that way.


Diego.

Reply via email to