From e4b04d2677b9260a7e80d304b8a31e577894ae96 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Tue, 20 May 2014 22:03:27 +0000 Subject: [PATCH] RAV reunification: merge DISPATCH_STMT() macro back to standard RAV Also add the missing undef in both files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209245 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DataRecursiveASTVisitor.h | 2 ++ include/clang/AST/RecursiveASTVisitor.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/clang/AST/DataRecursiveASTVisitor.h b/include/clang/AST/DataRecursiveASTVisitor.h index b632ebf7f8..2a3e9d9b26 100644 --- a/include/clang/AST/DataRecursiveASTVisitor.h +++ b/include/clang/AST/DataRecursiveASTVisitor.h @@ -531,6 +531,8 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { return true; } +#undef DISPATCH_STMT + template bool RecursiveASTVisitor::TraverseType(QualType T) { if (T.isNull()) diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 422f039e2b..e1fa54829a 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -554,6 +554,8 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { if (!S) return true; +#define DISPATCH_STMT(NAME, CLASS, VAR) DISPATCH(NAME, CLASS, VAR) + if (getDerived().shouldUseDataRecursionFor(S)) return dataTraverse(S); @@ -564,7 +566,7 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { switch (BinOp->getOpcode()) { #define OPERATOR(NAME) \ case BO_##NAME: \ - DISPATCH(Bin##NAME, BinaryOperator, S); + DISPATCH_STMT(Bin##NAME, BinaryOperator, S); BINOP_LIST() #undef OPERATOR @@ -572,7 +574,7 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { #define OPERATOR(NAME) \ case BO_##NAME##Assign: \ - DISPATCH(Bin##NAME##Assign, CompoundAssignOperator, S); + DISPATCH_STMT(Bin##NAME##Assign, CompoundAssignOperator, S); CAO_LIST() #undef OPERATOR @@ -582,7 +584,7 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { switch (UnOp->getOpcode()) { #define OPERATOR(NAME) \ case UO_##NAME: \ - DISPATCH(Unary##NAME, UnaryOperator, S); + DISPATCH_STMT(Unary##NAME, UnaryOperator, S); UNARYOP_LIST() #undef OPERATOR @@ -597,13 +599,15 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { #define ABSTRACT_STMT(STMT) #define STMT(CLASS, PARENT) \ case Stmt::CLASS##Class: \ - DISPATCH(CLASS, CLASS, S); + DISPATCH_STMT(CLASS, CLASS, S); #include "clang/AST/StmtNodes.inc" } return true; } +#undef DISPATCH_STMT + template bool RecursiveASTVisitor::TraverseType(QualType T) { if (T.isNull()) -- 2.40.0