how to load a cfg from a file by tree-ssa

Rob Quill rob.quill@gmail.com
Fri Nov 24 14:57:00 GMT 2006


On 24/11/06, Paolo Bonzini <paolo.bonzini@lu.unisi.ch> wrote:
> Rob Quill wrote:
> > On 24/11/06, Paolo Bonzini <paolo.bonzini@lu.unisi.ch> wrote:
> >> Rob Quill wrote:
> >> > I haven't looked into this yet, but as I think I may need to be able
> >> > to do something similar, is it possible to parse the cfg file that is
> >> > given out, and build a C structure like that?
> >>
> >> It seems to me that the answer had been already given in the message you
> >> fully quoted: we cannot help you.
> >
> > I don't wish to labour the point, but what I am trying to understand
> > is whether it is impossible or just impractical.
>
> It is neither impossible, nor impractical.  Rather, it is irrelevant as
> for as GCC is concerned: it is not within the scope of a compiler to
> read back the CFG that (it prints them out to aid debugging), and this
> is why GCC does not provide APIs to do so.
>
> All you have to do, is understand the output format (either by looking
> at tree-cfg.c or by "reverse engineering" it yourself), and write a
> corresponding parser.  The C structs you will use may be based on those
> in GCC (see basic-block.h) but probably will not because these will
> bring many other details on the GCC intermediate representation.

Excellent. This is what I expected I would have to do all along.

Thank you for your help.

Rob

> Paolo
>



More information about the Gcc mailing list