Switch over the tablegen to use much prettier range technology

Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def
files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104017 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Hunt 2010-05-18 06:22:21 +00:00
Родитель 80f93d9fe8
Коммит 7381d5cfbd
5 изменённых файлов: 13 добавлений и 24 удалений

Просмотреть файл

@ -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"

Просмотреть файл

@ -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:

Просмотреть файл

@ -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"

Просмотреть файл

@ -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);

Просмотреть файл

@ -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"