Names for structs from RECORD_TYPE trees

Zack Weinberg zack@codesourcery.com
Sun Sep 9 23:10:00 GMT 2001


On Sun, Sep 09, 2001 at 10:49:07PM -0700, David Morse wrote:
> 
> Can anyone think of a way to fetch the name of a struct from its tree
> node?  Given a node for a structure, with TREE_CODE (t) == RECORD_TYPE, I
> find that DECL_NAME (TYPE_NAME (t)) returns NULL_TREE.  

TYPE_NAME (t) is an IDENTIFIER_NODE.  Try
IDENTIFIER_POINTER (TYPE_NAME (t)).

zw



More information about the Gcc mailing list