[PATCH] Reworked paragraph in FrontendAction tutorial

Christian Bielert cib123 at googlemail.com
Tue Sep 10 03:43:45 PDT 2013


The paragraph explaining how each AST node class had its own overloaded hook in RecursiveASTVisitor didn't seem very clear to me. Reworked it in an attempt to be more explicit on what's actually happening.

http://llvm-reviews.chandlerc.com/D1636

Files:
  docs/RAVFrontendAction.rst

Index: docs/RAVFrontendAction.rst
===================================================================
--- docs/RAVFrontendAction.rst
+++ docs/RAVFrontendAction.rst
@@ -60,10 +60,11 @@
 Now that everything is hooked up, the next step is to implement a
 RecursiveASTVisitor to extract the relevant information from the AST.
 
-The RecursiveASTVisitor provides hooks of the form bool
-VisitNodeType(NodeType \*) for most AST nodes; the exception are TypeLoc
-nodes, which are passed by-value. We only need to implement the methods
-for the relevant node types.
+If you wish to extract AST nodes of class *NodeType*, you would overload
+the function Visit\ *NodeType*\ (\ *NodeType* \*) in RecursiveASTVisitor;
+the exception are TypeLoc nodes, which are passed by-value, so for these
+you would overload Visit\ *NodeType*\ (\ *NodeType*). We only need
+to implement the methods for the relevant node types.
 
 Let's start by writing a RecursiveASTVisitor that visits all
 CXXRecordDecl's.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1636.1.patch
Type: text/x-patch
Size: 986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130910/0fa8d9c0/attachment.bin>


More information about the cfe-commits mailing list