[cfe-commits] r105795 - /cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Chandler Carruth chandlerc at gmail.com
Thu Jun 10 16:27:51 PDT 2010


Author: chandlerc
Date: Thu Jun 10 18:27:51 2010
New Revision: 105795

URL: http://llvm.org/viewvc/llvm-project?rev=105795&view=rev
Log:
Tweak a comment on the visitor to clarify one order of visit issue. Patch from
Zhanyong Wan.

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=105795&r1=105794&r2=105795&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Thu Jun 10 18:27:51 2010
@@ -70,6 +70,12 @@
 /// tier (e.g. other Traverse*) or one tier lower (e.g. WalkUpFrom*).
 /// It may not call methods from a higher tier.
 ///
+/// Note that since WalkUpFromFoo() calls WalkUpFromBar() (where Bar
+/// is Foo's super class) before calling VisitFoo(), the result is
+/// that the Visit*() methods for a given node are called in the
+/// top-down order (e.g. for a node of type NamedDecl, the order will
+/// be VisitDecl(), VisitNamedDecl(), and then VisitNamespaceDecl()).
+///
 /// This scheme guarantees that all Visit*() calls for the same AST
 /// node are grouped together.  In other words, Visit*() methods for
 /// different nodes are never interleaved.





More information about the cfe-commits mailing list