This is the mail archive of the gcc@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: Traversing typedef hierarchy in C/C++ tree


Boris Kolpackov <boris@codesynthesis.com> writes:

> Ian Lance Taylor <iant@google.com> writes:
>
>> As far as I know this is not possible.  A typedef name is just an alias
>> for the underlying type.  When you typedef T as TNAME, where T is itself
>> a typedef, GCC records that TNAME is a name for the underlying type of
>> T. It does not record an equivalence of T and TNAME.  The C/C++
>> language do not require GCC to keep track of this information, and it's
>> simpler for the frontend to just maintain a list.
>
> Yes, that's what I suspect. Which is unfortunate since GCC already creates
> all the nodes. All that is left is to establish a link between two types.
> While this is not necessary for C/C++ compilation, it could be useful for
> other tools that can now be built with the GCC plugin architecture.

If you can make that work without using any extra memory and without
making it more expensive to handle typedefs, I expect that the patch
would be acceptable.

Ian


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