[cfe-commits] r104017 - in /cfe/trunk: include/clang/AST/RecursiveASTVisitor.h include/clang/AST/Stmt.h include/clang/AST/StmtVisitor.h lib/AST/Stmt.cpp lib/Sema/TreeTransform.h
Sean Hunt
rideau3 at gmail.com
Mon May 17 23:22:21 PDT 2010
Author: coppro
Date: Tue May 18 01:22:21 2010
New Revision: 104017
URL: http://llvm.org/viewvc/llvm-project?rev=104017&view=rev
Log:
Switch over the tablegen to use much prettier range technology
Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def
files
Modified:
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/AST/StmtVisitor.h
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=104017&r1=104016&r2=104017&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue May 18 01:22:21 2010
@@ -240,7 +240,7 @@
// 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"
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=104017&r1=104016&r2=104017&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Tue May 18 01:22:21 2010
@@ -98,24 +98,13 @@
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:
Modified: cfe/trunk/include/clang/AST/StmtVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtVisitor.h?rev=104017&r1=104016&r2=104017&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtVisitor.h (original)
+++ cfe/trunk/include/clang/AST/StmtVisitor.h Tue May 18 01:22:21 2010
@@ -105,7 +105,7 @@
// 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"
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=104017&r1=104016&r2=104017&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Tue May 18 01:22:21 2010
@@ -36,7 +36,7 @@
// 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);
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=104017&r1=104016&r2=104017&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue May 18 01:22:21 2010
@@ -344,7 +344,7 @@
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 @@
// 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 @@
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"
More information about the cfe-commits
mailing list