[cfe-commits] r103993 - /cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
Nick Lewycky
nicholas at mxc.ca
Mon May 17 16:15:38 PDT 2010
Author: nicholas
Date: Mon May 17 18:15:38 2010
New Revision: 103993
URL: http://llvm.org/viewvc/llvm-project?rev=103993&view=rev
Log:
Add a 'Base' type to RecursiveASTVisitor to make recursing easier and document
how you're supposed to use it.
Modified:
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=103993&r1=103992&r2=103993&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Mon May 17 18:15:38 2010
@@ -40,14 +40,17 @@
*
* 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); }
More information about the cfe-commits
mailing list