forked from OSchip/llvm-project
Add a 'Base' type to RecursiveASTVisitor to make recursing easier and document
how you're supposed to use it. llvm-svn: 103993
This commit is contained in:
parent
02d3368831
commit
47b92a2cc4
|
@ -43,11 +43,14 @@ return static_cast<Derived*>(this)->Visit ## NAME(static_cast<CLASS*>(Var))
|
|||
* 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.
|
||||
* 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); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue