diff options
| author | Alp Toker <alp@nuanti.com> | 2014-05-20 22:03:27 +0000 |
|---|---|---|
| committer | Alp Toker <alp@nuanti.com> | 2014-05-20 22:03:27 +0000 |
| commit | 8425c43c2adec1395c68ba524e9a9a25f8eebe3a (patch) | |
| tree | 8c877cdb3c0558efbce23607f76d42678a8907f4 | |
| parent | d92674ce8163fd182b8a5c5413a3696f1722c61c (diff) | |
| download | bcm5719-llvm-8425c43c2adec1395c68ba524e9a9a25f8eebe3a.tar.gz bcm5719-llvm-8425c43c2adec1395c68ba524e9a9a25f8eebe3a.zip | |
RAV reunification: merge DISPATCH_STMT() macro back to standard RAV
Also add the missing undef in both files.
llvm-svn: 209245
| -rw-r--r-- | clang/include/clang/AST/DataRecursiveASTVisitor.h | 2 | ||||
| -rw-r--r-- | clang/include/clang/AST/RecursiveASTVisitor.h | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/clang/include/clang/AST/DataRecursiveASTVisitor.h b/clang/include/clang/AST/DataRecursiveASTVisitor.h index b632ebf7f87..2a3e9d9b26d 100644 --- a/clang/include/clang/AST/DataRecursiveASTVisitor.h +++ b/clang/include/clang/AST/DataRecursiveASTVisitor.h @@ -531,6 +531,8 @@ bool RecursiveASTVisitor<Derived>::TraverseStmt(Stmt *S) { return true; } +#undef DISPATCH_STMT + template <typename Derived> bool RecursiveASTVisitor<Derived>::TraverseType(QualType T) { if (T.isNull()) diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index 422f039e2b7..e1fa54829a3 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -554,6 +554,8 @@ bool RecursiveASTVisitor<Derived>::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<Derived>::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<Derived>::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<Derived>::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<Derived>::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 <typename Derived> bool RecursiveASTVisitor<Derived>::TraverseType(QualType T) { if (T.isNull()) |

