[PATCH 15/18] move REAL_IDENTIFIER_TYPE_VALUE to be a field of lang_identifier
Jason Merrill
jason@redhat.com
Fri Mar 11 15:04:00 GMT 2011
On 03/11/2011 09:19 AM, Nathan Froyd wrote:
> On Fri, Mar 11, 2011 at 06:04:45AM -0800, Nathan Froyd wrote:
>> On Fri, Mar 11, 2011 at 08:40:24AM -0500, Jason Merrill wrote:
>>> On 03/10/2011 11:23 PM, Nathan Froyd wrote:
>>> The C++ FE expects that we can check the TREE_TYPE of anything that
>>> appears as an expression, and uses IDENTIFIER_NODE to indicate a
>>> dependent name within templates. If you want to break TREE_TYPE on
>>> IDENTIFIER_NODE, you need to change the representation of dependent
>>> names so that we can continue to use TREE_TYPE on all expressions.
>>
>> I'm confused. Isn't this what the switching on IDENTIFIER_NODE in a
>> number of places is doing? (And any future places that g++/libstdc++
>> didn't catch will be an ICE.) Or are you saying that you don't want the
>> switching and IDENTIFIER_NODEs should retain TREE_TYPE unless and until
>> somebody comes forth with a better design?
The latter.
> Or, alternatively, are you saying that blindly replacing TREE_TYPE with
> REAL_IDENTIFIER_TYPE_VALUE is wrong, semantically speaking, as TREE_TYPE
> and REAL_IDENTIFIER_TYPE_VALUE mean different things and should be kept
> separate, even if they happen to share the same storage?
This too. I'm surprised that them sharing the same storage hasn't
broken anything yet.
> And if so,
> would moving that storage into lang_identifier be OK
Moving the uses of REAL_IDENTIFIER_TYPE_VALUE into lang_identifier or
even a separate hash table would be OK.
> so long as the
> requisite occurrences of TREE_TYPE are audited and the appropriate name
> (REAL_IDENTIFIER_TYPE_VALUE vs. ...I don't know, EXPR_LIKE_TYPE) is
> used?
No, I want to keep using TREE_TYPE. I was thinking of something more
like the DEPENDENT_NAME_EXPR that Joseph mentioned.
Jason
More information about the Gcc-patches
mailing list