diff options
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 36b151ddf3..1b2f3a79dd 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -40,14 +40,17 @@ return static_cast<Derived*>(this)->Visit ## NAME(static_cast<CLASS*>(Var)) * * Clients of this visitor should subclass the visitor (providing themselves * as the template argument, using the curiously recurring template pattern) - * and override any of the Visit* methods for declaration, type, statement, - * expression, or other AST nodes where the visitor should customize - * behavior. Returning "true" from one of these overridden functions will - * abort the traversal. + * and override any of the Visit* methods for declaration, type, statement, + * expression, or other AST nodes where the visitor should customize + * behavior. Returning "true" from one of these overridden functions will + * abort the entire traversal. An overridden Visit* method will not descend + * further into the AST for that node unless Base::Visit* is called. */ template<typename Derived> class RecursiveASTVisitor { public: + typedef RecursiveASTVisitor<Derived> Base; + /// \brief Return a reference to the derived class. Derived &getDerived() { return *static_cast<Derived*>(this); } |