This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using gcc to build a control flow graph


2008/11/3 Tanya Gornak <errizo@gmail.com>:

> Could you please recommend me a way to extract control flow graph from gcc?

Depending on how much analysis you need to do, you could just request
the basic block boundaries dumped together with the IL using:

$ gcc -fdump-tree-ssa-blocks ...

This gives you a dump right after the program is in SSA form.  The
basic block boundaries can then be post-processed to generate a graph
drawing input file.  Most optimization passes will also accept the
-blocks modifier, so you can produce a CFG out of any pass.

However, if you need to interact with the CFG in deeper ways, then
you'll have to write a proper GCC pass.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]