diff options
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 2 | ||||
-rw-r--r-- | include/clang/AST/Stmt.h | 25 | ||||
-rw-r--r-- | include/clang/AST/StmtVisitor.h | 2 | ||||
-rw-r--r-- | lib/AST/Stmt.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/TreeTransform.h | 6 |
5 files changed, 13 insertions, 24 deletions
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 1b2f3a79dd..9762a83615 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -240,7 +240,7 @@ DISPATCH(UnaryOperator, UnaryOperator, S); \ // Top switch stmt: dispatch to VisitFooStmt for each FooStmt. switch (S->getStmtClass()) { case Stmt::NoStmtClass: break; -#define ABSTRACT(STMT) +#define ABSTRACT_STMT(STMT) #define STMT(CLASS, PARENT) \ case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS, S); #include "clang/AST/StmtNodes.inc" diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index f95c35a126..f2c067a05f 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -98,24 +98,13 @@ public: enum StmtClass { NoStmtClass = 0, #define STMT(CLASS, PARENT) CLASS##Class, -#define FIRST_STMT(CLASS) firstStmtConstant = CLASS##Class, -// LAST_STMT will always come last -#define LAST_STMT(CLASS) lastStmtConstant = CLASS##Class -#define FIRST_EXPR(CLASS) firstExprConstant = CLASS##Class, -#define LAST_EXPR(CLASS) lastExprConstant = CLASS##Class, -#define FIRST_CALLEXPR(CLASS) firstCallExprConstant = CLASS##Class, -#define LAST_CALLEXPR(CLASS) lastCallExprConstant = CLASS##Class, -#define FIRST_CASTEXPR(CLASS) firstCastExprConstant = CLASS##Class, -#define LAST_CASTEXPR(CLASS) lastCastExprConstant = CLASS##Class, -#define FIRST_EXPLICITCASTEXPR(CLASS) firstExplicitCastExprConstant = \ - CLASS##Class, -#define LAST_EXPLICITCASTEXPR(CLASS) lastExplicitCastExprConstant = \ - CLASS##Class, -#define FIRST_BINARYOPERATOR(CLASS) firstBinaryOperatorConstant = \ - CLASS##Class, -#define LAST_BINARYOPERATOR(CLASS) lastBinaryOperatorConstant = \ - CLASS##Class, -#define ABSTRACT(STMT) +#define STMT_RANGE(BASE, FIRST, LAST) \ + first##BASE##Constant = FIRST##Class, \ + last##BASE##Constant = LAST##Class, +#define LAST_STMT_RANGE(BASE, FIRST, LAST) \ + first##BASE##Constant = FIRST##Class, \ + last##BASE##Constant = LAST##Class +#define ABSTRACT_STMT(STMT) #include "clang/AST/StmtNodes.inc" }; private: diff --git a/include/clang/AST/StmtVisitor.h b/include/clang/AST/StmtVisitor.h index f1d478ded4..8078451fa3 100644 --- a/include/clang/AST/StmtVisitor.h +++ b/include/clang/AST/StmtVisitor.h @@ -105,7 +105,7 @@ public: // Top switch stmt: dispatch to VisitFooStmt for each FooStmt. switch (S->getStmtClass()) { default: assert(0 && "Unknown stmt kind!"); -#define ABSTRACT(STMT) +#define ABSTRACT_STMT(STMT) #define STMT(CLASS, PARENT) \ case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS); #include "clang/AST/StmtNodes.inc" diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index f6f3ae5c88..80f5695e42 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -36,7 +36,7 @@ static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) { // Intialize the table on the first use. Initialized = true; -#define ABSTRACT(STMT) +#define ABSTRACT_STMT(STMT) #define STMT(CLASS, PARENT) \ StmtClassInfo[(unsigned)Stmt::CLASS##Class].Name = #CLASS; \ StmtClassInfo[(unsigned)Stmt::CLASS##Class].Size = sizeof(CLASS); diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 7f756ec4ce..37264a6cb3 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -344,7 +344,7 @@ public: OwningStmtResult Transform##Node(Node *S); #define EXPR(Node, Parent) \ OwningExprResult Transform##Node(Node *E); -#define ABSTRACT(Stmt) +#define ABSTRACT_STMT(Stmt) #include "clang/AST/StmtNodes.inc" /// \brief Build a new pointer type given its pointee type. @@ -1958,7 +1958,7 @@ Sema::OwningStmtResult TreeTransform<Derived>::TransformStmt(Stmt *S) { // Transform expressions by calling TransformExpr. #define STMT(Node, Parent) -#define ABSTRACT(Stmt) +#define ABSTRACT_STMT(Stmt) #define EXPR(Node, Parent) case Stmt::Node##Class: #include "clang/AST/StmtNodes.inc" { @@ -1982,7 +1982,7 @@ Sema::OwningExprResult TreeTransform<Derived>::TransformExpr(Expr *E) { switch (E->getStmtClass()) { case Stmt::NoStmtClass: break; #define STMT(Node, Parent) case Stmt::Node##Class: break; -#define ABSTRACT(Stmt) +#define ABSTRACT_STMT(Stmt) #define EXPR(Node, Parent) \ case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E)); #include "clang/AST/StmtNodes.inc" |