Reputation: 539
I've read this link but still don't fully understand what's the difference between TraverseDecl and VisitDecl (and their use case) http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html
Which method should I be overriding when writing my RecursiveASTVisitor?
Upvotes: 8
Views: 3801
Reputation: 693
TraverseDecl tells the frontend library's ASTConsumer to visit declarations recursively from the AST. Then VisitDecl is called where you can extract the relevant information.
Follow these two links for more details and a simple checker example:
http://clang.llvm.org/docs/RAVFrontendAction.html
How to traverse clang AST manually ?
Upvotes: 5