[cfe-dev] HowToGetAnalysisEquation
David Blaikie
dblaikie at gmail.com
Tue Oct 9 10:40:28 PDT 2012
On Tue, Oct 9, 2012 at 7:16 AM, redder_0210 <redder_0210 at yeah.net> wrote:
> 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.
How could that transfer occur?
> 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?
>
> Thank! s.
>
>
>
>
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
More information about the cfe-dev
mailing list