mercredi 1 mars 2017

clang AST for "__block"

I am working on clang front-end tool to do static analysis. I have this code snippet

int f25(int y) {
  __block int x = (y > 2);
  __block int z = 0;
  void (^foo)() = ^{ z = x + y; };
  x = 4; // no-warning
  foo();
  return z; 
}

It generates the following AST

enter image description here

As highlighted in red box, how to check that the DeclStmt is built-in using RecursiveASTVisitor?

Thanks, Hemant

Aucun commentaire:

Enregistrer un commentaire