scopes in CFGs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

scopes in CFGs

Evan Herbst
When I call buildCFG() with AddScopes = true, I get an end-scope node with no predecessors. EG

int main()
{
        return 0;
}

gives

<<<
  [ B3 (ENTRY) ]
     Predecessors (0):
     Successors (1): B2

  [ B1 ]
       1: end scope
     Predecessors (0):
     Successors (1): B0

  [ B2 ]
       1: start scope
       2: return 0;
     Predecessors (1): B3
     Successors (1): B0

  [ B0 (EXIT) ]
     Predecessors (2): B1 B2
     Successors (0):
 >>>

. I don't see any existing call of buildCFG() with AddScopes = true. Is this the intended behavior?

My code looks like

FunctionDecl* f = ...;
CFG* cfg = CFG::buildCFG(f, f->getBody(), &f->getASTContext(), false/* add exception handling edges */, true/* add
scopes */);
cfg->dump(LangOptions());

Thanks.

- Evan
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: scopes in CFGs

Ted Kremenek
Hi Evan,

This functionality isn't fully implemented.  I'll add a comment in the code.  Unfortunately I won't have time to look at finishing up this feature immediately, so if anyone wants to help take a crack at it please talk to me.

Best,
Ted

On Mar 15, 2010, at 10:06 AM, Evan Herbst wrote:

> When I call buildCFG() with AddScopes = true, I get an end-scope node with no predecessors. EG
>
> int main()
> {
> return 0;
> }
>
> gives
>
> <<<
>  [ B3 (ENTRY) ]
>     Predecessors (0):
>     Successors (1): B2
>
>  [ B1 ]
>       1: end scope
>     Predecessors (0):
>     Successors (1): B0
>
>  [ B2 ]
>       1: start scope
>       2: return 0;
>     Predecessors (1): B3
>     Successors (1): B0
>
>  [ B0 (EXIT) ]
>     Predecessors (2): B1 B2
>     Successors (0):
>>>>
>
> . I don't see any existing call of buildCFG() with AddScopes = true. Is this the intended behavior?
>
> My code looks like
>
> FunctionDecl* f = ...;
> CFG* cfg = CFG::buildCFG(f, f->getBody(), &f->getASTContext(), false/* add exception handling edges */, true/* add
> scopes */);
> cfg->dump(LangOptions());
>
> Thanks.
>
> - Evan
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev