scopes in CFGs

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

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