Question about rewriter.

Hi,

I’m trying to rewrite all DeclStmt-s in which type of variable in VarDecl is a pointer type and rewrite all operator new calls. I know that I can iterate all VarDecl-s by traversing AST and replace such statements, but how to get theirs types and names?

Thanks,

Daniil.

Hi,

I'm trying to rewrite all DeclStmt-s in which type of variable in VarDecl
is a pointer type and rewrite all operator new calls. I know that I can
iterate all VarDecl-s by traversing AST and replace such statements, but
how to get theirs types and names?

One way is to use the AST matchers:
http://clang.llvm.org/docs/LibASTMatchers.html

Apart from that, you can always try to traverse the AST on your own...
http://clang.llvm.org/docs/IntroductionToTheClangAST.html

Cheers,
/Manuel