public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aaron Lorey <lorey.bewerbung@gmail.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Mapping of TREE_CODE to tree_node
Date: Mon, 3 Jul 2023 02:46:55 +0200	[thread overview]
Message-ID: <CAL0NimZ=UF-o0_2bzDLTKstm+LjC+zpQP0DSOvJ5tGiaD8vpvQ@mail.gmail.com> (raw)
In-Reply-To: <fb2de23651b95e5e20f88947f908a4cc3e784d06.camel@redhat.com>

Am Mo., 26. Juni 2023 um 20:09 Uhr schrieb David Malcolm <dmalcolm@redhat.com>:
>
> On Mon, 2023-06-26 at 18:59 +0200, Aaron Lorey via Gcc 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?
>
> I don't know that such a mapping exists directly, but have a look at
> the functions "tree_code_size" and "tree_size" defined in gcc/tree.cc.
>
> You might also find the LTO streaming code of interest; see gcc/lto-
> streamer-{in,out}.cc
>
> Hope this is helpful
> Dave
>
>

Thank you for your reply.

The tree_size() and tree_code_size() functions are useful, although incomplete.

If I understand correctly, the link time optimization works on the
GIMPLE representation. The original syntax tree and symbol table would
be preferable.

Andrew's suggestion might be more what I'm looking for.

  reply	other threads:[~2023-07-03  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 16:59 Aaron Lorey
2023-06-26 17:45 ` Andrew Pinski
2023-06-26 18:08 ` David Malcolm
2023-07-03  0:46   ` Aaron Lorey [this message]
2023-07-03  0:50     ` Andrew Pinski
2023-08-11 23:30       ` Aaron Lorey
2023-08-15 20:00         ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL0NimZ=UF-o0_2bzDLTKstm+LjC+zpQP0DSOvJ5tGiaD8vpvQ@mail.gmail.com' \
    --to=lorey.bewerbung@gmail.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).