[cfe-dev] AST generation API?

Vassil Vassilev vasil.georgiev.vasilev at cern.ch
Mon Mar 26 02:38:41 PDT 2012


Hi,
On 03/20/2012 11:10 PM, John McCall wrote:
> One thing that we are definitely interested in having is an AST verifier akin to LLVM's IR verifier:  something which would explicitly check and enforce Clang's AST invariants.  This would make it much easier to do AST manipulations by both (1) documenting the invariants and (2) catching obvious problems where ASTs fail to conform.
>
   +1
   That would be really fantastic tool. We do AST transformations
and we definitely need a tool like that.
   What we do is getting the newly (generated/moved) AST node
and try to perform semantic checks on it, taking into account
its (new) place. For simple verifications we use Sema::Check* interfaces.
Some of them are quite useful like Sema::CheckVariableDeclaration.

   The question is can we reuse the existing functionality?
> John.
Cheers,
Vassil



More information about the cfe-dev mailing list