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

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Fri Nov 24 14:13:00 GMT 2006


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.

Paolo



More information about the Gcc mailing list