<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, May 18, 2014 at 1:06 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
On 18/05/2014 22:29, Argyrios Kyrtzidis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alp,<br>
<br>
Thanks for doing this!<br></blockquote></div></blockquote><div><br></div><div>+1 =)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm not sure what your long-term plan is but I recommend making RAV data recursive and changing its interface accordingly (add *Before/*After visitation callbacks and have clients adopt them, etc.).<br>
Having it code recursive is just a minefield of stack overflows.<br>
</blockquote>
<br></div>
Thanks for sharing your thoughts Argyrios<br>
<br>
I agree we'd do well to look at updating the way we do visitation in future.<br>
<br>
At the same time I'm mindful that adding pre-post visit variants needs to be done without doubling the amount of boilerplate code and maintenance work.<br>
<br>
So the short-term goal here is just to get the two copies of the file into check. In the best-case scenario they'll fold into one header without requiring any change to the consumers.<br></blockquote><div><br></div><div>
Even if we can't get back to a single visitor class, we should at least be able to factor out the differences into some kind of policy parameter to the template.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Looking to the future I hope we can start to generate visitation/serialization/<u></u>matcher routines, either using a central tablegen description of the AST or by introspecting annotated Decl/Stmt headers, which will reduce the cost of experimenting with new techniques.<br>

<br>
Alp.<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On May 18, 2014, at 11:38 AM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: alp<br>
Date: Sun May 18 13:38:08 2014<br>
New Revision: 209091<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=209091&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=209091&view=rev</a><br>
Log:<br>
Begin RAV reunification: s/DataRecursiveASTVisitor/<u></u>RecursiveASTVisitor/<br>
<br>
Define a macro to reduce the delta between RecursiveASTVisitor and<br>
DataRecursiveASTVisitor.<br>
<br>
Some years ago, someone thought it was a good idea to copy the entire RAV to<br>
support cursor visitation in libclang.<br>
<br>
Since then the two have diverged needlessly and the rest is history.<br>
<br>
This series of commits aims to reduce delta between the two so that we can<br>
reason about their differences, apply bugfixes that were only made to one but<br>
not the other, and ultimately find a way to unify two two chunks of code.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/<u></u>DataRecursiveASTVisitor.h<br>
<br>
Modified: cfe/trunk/include/clang/AST/<u></u>DataRecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=209091&r1=209090&r2=209091&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/include/<u></u>clang/AST/<u></u>DataRecursiveASTVisitor.h?rev=<u></u>209091&r1=209090&r2=209091&<u></u>view=diff</a><br>

==============================<u></u>==============================<u></u>==================<br>
--- cfe/trunk/include/clang/AST/<u></u>DataRecursiveASTVisitor.h (original)<br>
+++ cfe/trunk/include/clang/AST/<u></u>DataRecursiveASTVisitor.h Sun May 18 13:38:08 2014<br>
@@ -69,9 +69,13 @@<br>
<br>
namespace clang {<br>
<br>
+// Reduce the diff between RecursiveASTVisitor / DataRecursiveASTVisitor to<br>
+// make it easier to track changes and keep the two in sync.<br>
+#define RecursiveASTVisitor DataRecursiveASTVisitor<br>
+<br>
// A helper macro to implement short-circuiting when recursing.  It<br>
// invokes CALL_EXPR, which must be a method call, on the derived<br>
-// object (s.t. a user of DataRecursiveASTVisitor can override the method<br>
+// object (s.t. a user of RecursiveASTVisitor can override the method<br>
// in CALL_EXPR).<br>
#define TRY_TO(CALL_EXPR) \<br>
   do { if (!getDerived().CALL_EXPR) return false; } while (0)<br>
@@ -141,7 +145,7 @@ namespace clang {<br>
/// instantiations will be visited at the same time as the pattern<br>
/// from which they were produced.<br>
template<typename Derived><br>
-class DataRecursiveASTVisitor {<br>
+class RecursiveASTVisitor {<br>
public:<br>
   /// \brief Return a reference to the derived class.<br>
   Derived &getDerived() { return *static_cast<Derived*>(this); }<br>
@@ -438,9 +442,9 @@ private:<br>
   QueuesTy Queues;<br>
<br>
   class NewQueueRAII {<br>
-    DataRecursiveASTVisitor &RAV;<br>
+    RecursiveASTVisitor &RAV;<br>
   public:<br>
-    NewQueueRAII(StmtsTy &queue, DataRecursiveASTVisitor &RAV) : RAV(RAV) {<br>
+    NewQueueRAII(StmtsTy &queue, RecursiveASTVisitor &RAV) : RAV(RAV) {<br>
       RAV.Queues.push_back(&queue);<br>
     }<br>
     ~NewQueueRAII() {<br>
@@ -457,7 +461,7 @@ public:<br>
   class StmtQueueAction {<br>
     StmtsTy &CurrQueue;<br>
   public:<br>
-    explicit StmtQueueAction(<u></u>DataRecursiveASTVisitor &RAV)<br>
+    explicit StmtQueueAction(<u></u>RecursiveASTVisitor &RAV)<br>
       : CurrQueue(RAV.getCurrentQueue(<u></u>)) { }<br>
<br>
     void queue(Stmt *S) {<br>
@@ -470,7 +474,7 @@ public:<br>
   return getDerived().Traverse##NAME(<u></u>static_cast<CLASS*>(VAR))<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseStmt(Stmt *S) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseStmt(Stmt *S) {<br>
   if (!S)<br>
     return true;<br>
<br>
@@ -539,7 +543,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseType(<u></u>QualType T) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseType(QualType T) {<br>
   if (T.isNull())<br>
     return true;<br>
<br>
@@ -555,7 +559,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseTypeLoc(<u></u>TypeLoc TL) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTypeLoc(TypeLoc TL) {<br>
   if (TL.isNull())<br>
     return true;<br>
<br>
@@ -572,12 +576,12 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
<br>
<br>
// Define the Traverse*Attr(Attr* A) methods<br>
-#define VISITORCLASS DataRecursiveASTVisitor<br>
+#define VISITORCLASS RecursiveASTVisitor<br>
#include "clang/AST/AttrVisitor.inc"<br>
#undef VISITORCLASS<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseDecl(Decl *D) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseDecl(Decl *D) {<br>
   if (!D)<br>
     return true;<br>
<br>
@@ -608,7 +612,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
#undef DISPATCH<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseNestedNameSpecifier(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseNestedNameSpecifier(<br>
                                                     NestedNameSpecifier *NNS) {<br>
   if (!NNS)<br>
     return true;<br>
@@ -632,7 +636,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseNestedNameSpecifierLoc<u></u>(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseNestedNameSpecifierLoc<u></u>(<br>
                                                   NestedNameSpecifierLoc NNS) {<br>
   if (!NNS)<br>
     return true;<br>
@@ -657,7 +661,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseDeclarationNameInfo(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseDeclarationNameInfo(<br>
                                                  DeclarationNameInfo NameInfo) {<br>
   switch (NameInfo.getName().<u></u>getNameKind()) {<br>
   case DeclarationName::<u></u>CXXConstructorName:<br>
@@ -682,7 +686,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseTemplateName(<u></u>TemplateName Template) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTemplateName(<u></u>TemplateName Template) {<br>
   if (DependentTemplateName *DTN = Template.<u></u>getAsDependentTemplateName())<br>
     TRY_TO(<u></u>TraverseNestedNameSpecifier(<u></u>DTN->getQualifier()));<br>
   else if (QualifiedTemplateName *QTN = Template.<u></u>getAsQualifiedTemplateName())<br>
@@ -692,7 +696,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseTemplateArgument(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTemplateArgument(<br>
                                                 const TemplateArgument &Arg) {<br>
   switch (Arg.getKind()) {<br>
   case TemplateArgument::Null:<br>
@@ -723,7 +727,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
// FIXME: no template name location?<br>
// FIXME: no source locations for a template argument pack?<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseTemplateArgumentLoc(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTemplateArgumentLoc(<br>
                                            const TemplateArgumentLoc &ArgLoc) {<br>
   const TemplateArgument &Arg = ArgLoc.getArgument();<br>
<br>
@@ -762,7 +766,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseTemplateArguments(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTemplateArguments(<br>
                                                   const TemplateArgument *Args,<br>
                                                             unsigned NumArgs) {<br>
   for (unsigned I = 0; I != NumArgs; ++I) {<br>
@@ -773,7 +777,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseConstructorInitializer<u></u>(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseConstructorInitializer<u></u>(<br>
                                                      CXXCtorInitializer *Init) {<br>
   if (TypeSourceInfo *TInfo = Init->getTypeSourceInfo())<br>
     TRY_TO(TraverseTypeLoc(TInfo-><u></u>getTypeLoc()));<br>
@@ -784,7 +788,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template <typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseLambdaCapture(<u></u>LambdaCapture C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseLambdaCapture(<u></u>LambdaCapture C) {<br>
   return true;<br>
}<br>
<br>
@@ -793,7 +797,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
// This macro makes available a variable T, the passed-in type.<br>
#define DEF_TRAVERSE_TYPE(TYPE, CODE)                     \<br>
   template<typename Derived>                                           \<br>
-  bool DataRecursiveASTVisitor<<u></u>Derived>::Traverse##TYPE (TYPE *T) {        \<br>
+  bool RecursiveASTVisitor<Derived>::<u></u>Traverse##TYPE (TYPE *T) {        \<br>
     TRY_TO(WalkUpFrom##TYPE (T));                                      \<br>
     { CODE; }                                                          \<br>
     return true;                                                       \<br>
@@ -975,7 +979,7 @@ DEF_TRAVERSE_TYPE(AtomicType, {<br>
// continue to work.<br>
#define DEF_TRAVERSE_TYPELOC(TYPE, CODE)                                \<br>
   template<typename Derived>                                            \<br>
-  bool DataRecursiveASTVisitor<<u></u>Derived>::Traverse##TYPE##Loc(<u></u>TYPE##Loc TL) { \<br>
+  bool RecursiveASTVisitor<Derived>::<u></u>Traverse##TYPE##Loc(TYPE##Loc TL) { \<br>
     if (getDerived().<u></u>shouldWalkTypesOfTypeLocs())                       \<br>
       TRY_TO(WalkUpFrom##TYPE(const_<u></u>cast<TYPE*>(TL.getTypePtr())))<u></u>;     \<br>
     TRY_TO(WalkUpFrom##TYPE##Loc(<u></u>TL));                                  \<br>
@@ -984,7 +988,7 @@ DEF_TRAVERSE_TYPE(AtomicType, {<br>
   }<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseQualifiedTypeLoc(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseQualifiedTypeLoc(<br>
     QualifiedTypeLoc TL) {<br>
   // Move this over to the 'main' typeloc tree.  Note that this is a<br>
   // move -- we pretend that we were really looking at the unqualified<br>
@@ -1044,7 +1048,7 @@ DEF_TRAVERSE_TYPELOC(<u></u>AdjustedType, {<br>
   })<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseArrayTypeLocHelper(<u></u>ArrayTypeLoc TL) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseArrayTypeLocHelper(<u></u>ArrayTypeLoc TL) {<br>
   // This isn't available for ArrayType, but is for the ArrayTypeLoc.<br>
   TRY_TO(TraverseStmt(TL.<u></u>getSizeExpr()));<br>
   return true;<br>
@@ -1212,7 +1216,7 @@ DEF_TRAVERSE_TYPELOC(<u></u>AtomicType, {<br>
// than those.<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseDeclContextHelper(<u></u>DeclContext *DC) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseDeclContextHelper(<u></u>DeclContext *DC) {<br>
   if (!DC)<br>
     return true;<br>
<br>
@@ -1229,7 +1233,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
// This macro makes available a variable D, the passed-in decl.<br>
#define DEF_TRAVERSE_DECL(DECL, CODE)                           \<br>
template<typename Derived>                                      \<br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::Traverse##DECL (DECL *D) {   \<br>
+bool RecursiveASTVisitor<Derived>::<u></u>Traverse##DECL (DECL *D) {   \<br>
   TRY_TO(WalkUpFrom##DECL (D));                                 \<br>
   { CODE; }                                                     \<br>
   TRY_TO(<u></u>TraverseDeclContextHelper(dyn_<u></u>cast<DeclContext>(D)));  \<br>
@@ -1390,7 +1394,7 @@ DEF_TRAVERSE_DECL(<u></u>OMPThreadPrivateDecl,<br>
<br>
// A helper method for TemplateDecl's children.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseTemplateParameterListH<u></u>elper(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTemplateParameterListH<u></u>elper(<br>
     TemplateParameterList *TPL) {<br>
   if (TPL) {<br>
     for (TemplateParameterList::<u></u>iterator I = TPL->begin(), E = TPL->end();<br>
@@ -1404,7 +1408,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
// A helper method for traversing the implicit instantiations of a<br>
// class template.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseClassInstantiations(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseClassInstantiations(<br>
     ClassTemplateDecl *D) {<br>
   for (auto *SD : D->specializations()) {<br>
     for (auto *RD : SD->redecls()) {<br>
@@ -1457,7 +1461,7 @@ DEF_TRAVERSE_DECL(<u></u>ClassTemplateDecl, {<br>
// A helper method for traversing the implicit instantiations of a<br>
// class template.<br>
template <typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseVariableInstantiations<u></u>(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseVariableInstantiations<u></u>(<br>
     VarTemplateDecl *D) {<br>
   for (auto *SD : D->specializations()) {<br>
     for (auto *RD : SD->redecls()) {<br>
@@ -1508,7 +1512,7 @@ DEF_TRAVERSE_DECL(<br>
// A helper method for traversing the instantiations of a<br>
// function while skipping its specializations.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseFunctionInstantiations<u></u>(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseFunctionInstantiations<u></u>(<br>
     FunctionTemplateDecl *D) {<br>
   for (auto *FD : D->specializations()) {<br>
     for (auto *RD : FD->redecls()) {<br>
@@ -1609,7 +1613,7 @@ DEF_TRAVERSE_DECL(EnumDecl, {<br>
<br>
// Helper methods for RecordDecl and its children.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseRecordHelper(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseRecordHelper(<br>
     RecordDecl *D) {<br>
   // We shouldn't traverse D->getTypeForDecl(); it's a result of<br>
   // declaring the type, not something that was written in the source.<br>
@@ -1619,7 +1623,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseCXXRecordHelper(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseCXXRecordHelper(<br>
     CXXRecordDecl *D) {<br>
   if (!TraverseRecordHelper(D))<br>
     return false;<br>
@@ -1663,7 +1667,7 @@ DEF_TRAVERSE_DECL(<u></u>ClassTemplateSpecializ<br>
   })<br>
<br>
template <typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseTemplateArgumentLocsHe<u></u>lper(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseTemplateArgumentLocsHe<u></u>lper(<br>
     const TemplateArgumentLoc *TAL, unsigned Count) {<br>
   for (unsigned I = 0; I < Count; ++I) {<br>
     TRY_TO(<u></u>TraverseTemplateArgumentLoc(<u></u>TAL[I]));<br>
@@ -1706,7 +1710,7 @@ DEF_TRAVERSE_DECL(<u></u>UnresolvedUsingValueDe<br>
DEF_TRAVERSE_DECL(<u></u>IndirectFieldDecl, {})<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseDeclaratorHelper(<u></u>DeclaratorDecl *D) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseDeclaratorHelper(<u></u>DeclaratorDecl *D) {<br>
   TRY_TO(<u></u>TraverseNestedNameSpecifierLoc<u></u>(D->getQualifierLoc()));<br>
   if (D->getTypeSourceInfo())<br>
     TRY_TO(TraverseTypeLoc(D-><u></u>getTypeSourceInfo()-><u></u>getTypeLoc()));<br>
@@ -1742,7 +1746,7 @@ DEF_TRAVERSE_DECL(<u></u>ObjCIvarDecl, {<br>
   })<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseFunctionHelper(<u></u>FunctionDecl *D) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseFunctionHelper(<u></u>FunctionDecl *D) {<br>
   TRY_TO(<u></u>TraverseNestedNameSpecifierLoc<u></u>(D->getQualifierLoc()));<br>
   TRY_TO(<u></u>TraverseDeclarationNameInfo(D-<u></u>>getNameInfo()));<br>
<br>
@@ -1817,7 +1821,7 @@ DEF_TRAVERSE_DECL(<u></u>CXXDestructorDecl, {<br>
   })<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseVarHelper(<u></u>VarDecl *D) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseVarHelper(VarDecl *D) {<br>
   TRY_TO(<u></u>TraverseDeclaratorHelper(D));<br>
   // Default params are taken care of when we traverse the ParmVarDecl.<br>
   if (!isa<ParmVarDecl>(D))<br>
@@ -1905,7 +1909,7 @@ DEF_TRAVERSE_DECL(ParmVarDecl, {<br>
// This macro makes available a variable S, the passed-in stmt.<br>
#define DEF_TRAVERSE_STMT(STMT, CODE)                                   \<br>
template<typename Derived>                                              \<br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::Traverse##STMT (STMT *S) {           \<br>
+bool RecursiveASTVisitor<Derived>::<u></u>Traverse##STMT (STMT *S) {           \<br>
   TRY_TO(WalkUpFrom##STMT(S));                                          \<br>
   StmtQueueAction StmtQueue(*this);                                     \<br>
   { CODE; }                                                             \<br>
@@ -2052,7 +2056,7 @@ DEF_TRAVERSE_STMT(<u></u>CXXStaticCastExpr, {<br>
// calls WalkUp*() on the semantic form, before our code can convert<br>
// to the syntactic form.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseInitListExpr(<u></u>InitListExpr *S) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseInitListExpr(<u></u>InitListExpr *S) {<br>
   if (InitListExpr *Syn = S->getSyntacticForm())<br>
     S = Syn;<br>
   TRY_TO(WalkUpFromInitListExpr(<u></u>S));<br>
@@ -2068,7 +2072,7 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
// are interleaved.  We also need to watch out for null types (default<br>
// generic associations).<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<br>
+bool RecursiveASTVisitor<Derived>::<br>
TraverseGenericSelectionExpr(<u></u>GenericSelectionExpr *S) {<br>
   TRY_TO(<u></u>WalkUpFromGenericSelectionExpr<u></u>(S));<br>
   StmtQueueAction StmtQueue(*this);<br>
@@ -2084,7 +2088,7 @@ TraverseGenericSelectionExpr(<u></u>GenericSele<br>
// PseudoObjectExpr is a special case because of the wierdness with<br>
// syntactic expressions and opaque values.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<br>
+bool RecursiveASTVisitor<Derived>::<br>
TraversePseudoObjectExpr(<u></u>PseudoObjectExpr *S) {<br>
   TRY_TO(<u></u>WalkUpFromPseudoObjectExpr(S))<u></u>;<br>
   StmtQueueAction StmtQueue(*this);<br>
@@ -2164,7 +2168,7 @@ DEF_TRAVERSE_STMT(<u></u>CXXTemporaryObjectExpr<br>
<br>
// Walk only the visible parts of lambda expressions.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseLambdaExpr(<u></u>LambdaExpr *S) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseLambdaExpr(LambdaExpr *S) {<br>
   TRY_TO(WalkUpFromLambdaExpr(S)<u></u>);<br>
<br>
   for (LambdaExpr::capture_iterator C = S->explicit_capture_begin(),<br>
@@ -2323,7 +2327,7 @@ DEF_TRAVERSE_STMT(AsTypeExpr, { })<br>
<br>
// OpenMP directives.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>TraverseOMPExecutableDirective<u></u>(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseOMPExecutableDirective<u></u>(<br>
                                                OMPExecutableDirective *S) {<br>
   ArrayRef<OMPClause *> Clauses = S->clauses();<br>
   for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();<br>
@@ -2342,7 +2346,7 @@ DEF_TRAVERSE_STMT(<u></u>OMPSimdDirective, {<br>
<br>
// OpenMP clauses.<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::TraverseOMPClause(<u></u>OMPClause *C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>TraverseOMPClause(OMPClause *C) {<br>
   if (!C) return true;<br>
   switch (C->getClauseKind()) {<br>
#define OPENMP_CLAUSE(Name, Class)                                      \<br>
@@ -2355,72 +2359,72 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::T<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::VisitOMPIfClause(<u></u>OMPIfClause *C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPIfClause(OMPIfClause *C) {<br>
   TraverseStmt(C->getCondition()<u></u>);<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPNumThreadsClause(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPNumThreadsClause(<br>
                                                     OMPNumThreadsClause *C) {<br>
   TraverseStmt(C->getNumThreads(<u></u>));<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPSafelenClause(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPSafelenClause(<br>
                                             OMPSafelenClause *C) {<br>
   TraverseStmt(C->getSafelen());<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPDefaultClause(<u></u>OMPDefaultClause *C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPDefaultClause(<u></u>OMPDefaultClause *C) {<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
bool<br>
-DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPProcBindClause(<u></u>OMPProcBindClause *C) {<br>
+RecursiveASTVisitor<Derived>:<u></u>:VisitOMPProcBindClause(<u></u>OMPProcBindClause *C) {<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
template<typename T><br>
-void DataRecursiveASTVisitor<<u></u>Derived>::VisitOMPClauseList(T *Node) {<br>
+void RecursiveASTVisitor<Derived>::<u></u>VisitOMPClauseList(T *Node) {<br>
   for (auto *I : Node->varlists())<br>
     TraverseStmt(I);<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPPrivateClause(<u></u>OMPPrivateClause *C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPPrivateClause(<u></u>OMPPrivateClause *C) {<br>
   VisitOMPClauseList(C);<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPFirstprivateClause(<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPFirstprivateClause(<br>
                                                     OMPFirstprivateClause *C) {<br>
   VisitOMPClauseList(C);<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPSharedClause(<u></u>OMPSharedClause *C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPSharedClause(<u></u>OMPSharedClause *C) {<br>
   VisitOMPClauseList(C);<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
bool<br>
-DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPLinearClause(<u></u>OMPLinearClause *C) {<br>
+RecursiveASTVisitor<Derived>:<u></u>:VisitOMPLinearClause(<u></u>OMPLinearClause *C) {<br>
   VisitOMPClauseList(C);<br>
   TraverseStmt(C->getStep());<br>
   return true;<br>
}<br>
<br>
template<typename Derived><br>
-bool DataRecursiveASTVisitor<<u></u>Derived>::<u></u>VisitOMPCopyinClause(<u></u>OMPCopyinClause *C) {<br>
+bool RecursiveASTVisitor<Derived>::<u></u>VisitOMPCopyinClause(<u></u>OMPCopyinClause *C) {<br>
   VisitOMPClauseList(C);<br>
   return true;<br>
}<br>
@@ -2446,6 +2450,8 @@ bool DataRecursiveASTVisitor<<u></u>Derived>::V<br>
<br>
#undef TRY_TO<br>
<br>
+#undef RecursiveASTVisitor<br>
+<br>
} // end namespace clang<br>
<br>
#endif // LLVM_CLANG_LIBCLANG_<u></u>RECURSIVEASTVISITOR_H<br>
<br>
<br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</blockquote></blockquote>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>