This is the mail archive of the gcc-patches@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]

control flow graphs of functions


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


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