[cfe-dev] HowToGetAnalysisEquation

redder_0210 redder_0210 at yeah.net
Tue Oct 9 07:16:03 PDT 2012


Dear all,
Considering the following code:
//////////////////////////////////////////////////////////begin
int MC(int n){
    int r,t1,t2;
    if(n > 100){
        r = n - 10;
    }
    else{
       t1 = n + 11;
       t2 = MC(t1);
       r = MC(t2);
    }
    return n;
}
/////////////////////////////////////////////////////////end


///////////////////////////////////////////////////////////////
Now I have got the CFG for the code:
B5: 
     Entry block;
succBlock: B4;


B4:
      int r,t1,t2;
      if(n > 100)
succBlock: B3, B2;


B3:
     r = n - 10;
succBlock: B1;


B2:
    t1 = n + 11;
    t2 = MC(t1);
    r = MC(t2);
succBlock: B2;


B1:
   return r;


////////////////////////////////////////////////////////////////


But the CFG doesn't contain the full information for the data flow:  for example, 
  In the Block B2, the statement "t1 = n + 11;" could transfer data flow to the Entry Block.
While the CFG doesn't express the transfer information.
So, my question is how to get the information for the whole data flow information based on the CFG?


Thanks.











-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121009/49516d42/attachment.html>


More information about the cfe-dev mailing list