This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
control flow graphs of functions
- To: gcc-patches at gcc dot gnu dot org
- Subject: control flow graphs of functions
- From: Fu-hau Hsu <fhsu at ic dot sunysb dot edu>
- Date: Fri, 9 Mar 2001 17:26:03 -0500 (EST)
- cc: Fu-hau Hsu <fhsu at ic dot sunysb dot edu>
Dear frineds:
For each C function, I would like to build a graph to describe the
relationship of control transfer among all the functions inside that
function. What follows is am example, where foo(), fa(), fb(),
fc(), fd(), and fe() are all C functions.
foo()
{
int a,b,c;
fd();
if(a>b)
fa();
else
if(b>c)
fb()
else
fc();
fe();
}
So, for foo() I would like to build a graph as follows :
fd()
/ \ \
/ \ \
fa() fb() fc()
\ | /
\ | /
fe()
Does gcc have any data struct that describe the above info after it
compiles a program? If yes, in which place of the gcc source code this
data structure is created?
BTW, except the GNU document, is there any other document talking about
"RTL"?
Any suggestion is highly appreciated. Thank you very much.
Best Regards,
FuHau