On Mon, Jun 26, 2023 at 10:01 AM Aaron Lorey via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hello,
>
> this is the first time I am writing to a mailing list. I've tried
> researching the normal procedure but nothing special seems to be required.
>
> I'm currently trying to do a complete graph-discovery of GCC's symtab /
> tree_nodes to dump the full internal representation of the compilation
> unit. Gitlab: https://gitlab.com/graph-prog/code-database
>
> It is not exceptionally heavy but also not very easy to serialize the
> internal state to disk. I think this task was simply not considered in the
> design.
>
> Reason for writing to the mailing list are the troubles in connecting the
> TREE_CODE enumeration to the appropriate struct tree_node memory layout
> without guessing.
>
> Can you provide a mapping of TREE_CODE to tree_node memory layout?

See tree_node_structure_for_code and tree_node's GTY marker for tag.
e.g:
  struct tree_string GTY ((tag ("TS_STRING"))) string;

Says this is used when the tag is TS_STRING.
and TS_STRING is used for tree code STRING_CST:
    case STRING_CST:            return TS_STRING;

For front-end specific trees there is a front-end specific function
which does the mapping for those too.

Thanks,
Andrew Pinski

>
> kind regards

Reply via email to