This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Does -fdump-tree-original-raw dumps out the full AST?
- From: Diego Novillo <dnovillo at google dot com>
- To: Francois Berenger <francois dot berenger dot working at gmail dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Thu, 24 Jul 2014 12:05:52 -0400
- Subject: Re: Does -fdump-tree-original-raw dumps out the full AST?
- Authentication-results: sourceware.org; auth=none
- References: <CAMQaOgNRP4=kYwWOZGxDCCBdcetHFGzQvZ2jWXTyfXAxzWXUvw at mail dot gmail dot com> <CAD_=9DTL0HQtLzN=XAfUHA4i3QR+doKqehdnMP_ZoE-aL3S3rw at mail dot gmail dot com> <CAMQaOgOO+COs-uHV-dUTZG9mz=KCV=+JhN-wkimoAuRsoQRtiA at mail dot gmail dot com>
On Thu, Jul 24, 2014 at 11:57 AM, Francois Berenger
<francois.berenger.working@gmail.com> wrote:
> On Thu, Jul 24, 2014 at 4:29 PM, Diego Novillo <dnovillo@google.com> wrote:
>> On Thu, Jul 24, 2014 at 7:17 AM, Francois Berenger
>> <francois.berenger.working@gmail.com> wrote:
>>
>>> Complete in the sense that, by parsing back this text file
>>> with an external program it would be possible to reconstruct the original AST
>>> that gcc was working on (and dumped out).
>>
>> It isn't. These dumps are meant to be debugging aids. It is not
>> possible to reconstruct the original program out of them.
>
> Would it be possible to make these dumps complete?
> Let's say for the C frontend of gcc.
That's likely to be a significant effort. The tree representation is
not really streamable. The front end keeps a lot of state in-memory
that is not attached to the tree themselves.
There was some preliminary effort to achieve this with the pre-parsed
headers project (a precursor to C++ modules). We've since abandoned
the effort, but you can still get at the code and documentation:
https://gcc.gnu.org/wiki/pph
Diego.