We're out of tree codes; now what?
Ian Lance Taylor
iant@google.com
Wed Mar 14 14:36:00 GMT 2007
"Doug Gregor" <doug.gregor@gmail.com> writes:
> Of course, one could use TREE_CODE to see through the difference
> between these two, e.g.,
>
> #define TREE_CODE(NODE)
> ((enum tree_code) (NODE)->base.code == LANG_TYPE?
> (enum tree_code)((TYPE_LANG_SPECIFIC (NODE)->base.subcode +
> LAST_AND_UNUSED_TREE_CODE))
> : (enum tree_code) (NODE)->base.code)
>
> Then, the opposite for TREE_SET_CODE:
> #define TREE_SET_CODE(NODE, VALUE)
> ((VALUE) >= LAST_AND_USED_TREE_CODE)?
> ((NODE)->base.code = LANG_TYPE, get_type_lang_specific
> (NODE)->base.subcode = (VALUE) - LAST_AND_USED_TREE_CODE)
> : ((NODE)->base.code = (VALUE))
>
> Yuck.
I would use 256 instead of LAST_AND_USED_TREE_CODE, but other than
that it doesn't seem so yucky to me.
Maybe my sense of taste has become degraded.
Ian
More information about the Gcc
mailing list