[cfe-commits] r39117 - in /cfe/cfe/trunk: AST/StmtVisitor.cpp clang.xcodeproj/project.pbxproj include/clang/AST/StmtNodes.def

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:27:41 PDT 2007


Author: sabre
Date: Wed Jul 11 11:27:41 2007
New Revision: 39117

URL: http://llvm.org/viewvc/llvm-project?rev=39117&view=rev
Log:
Add a new StmtNodes.def file as a catalog of all the Stmt's.  This helps
eliminate repetitive code.

Added:
    cfe/cfe/trunk/include/clang/AST/StmtNodes.def   (with props)
Modified:
    cfe/cfe/trunk/AST/StmtVisitor.cpp
    cfe/cfe/trunk/clang.xcodeproj/project.pbxproj

Modified: cfe/cfe/trunk/AST/StmtVisitor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/StmtVisitor.cpp?rev=39117&r1=39116&r2=39117&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/StmtVisitor.cpp (original)
+++ cfe/cfe/trunk/AST/StmtVisitor.cpp Wed Jul 11 11:27:41 2007
@@ -20,30 +20,8 @@
   // Out-of-line virtual dtor.
 }
 
-#define DELEGATE_VISITOR(FROM, TO) \
+// Implement all of the delegation visitor methods.
+#define STMT(FROM, TO) \
   void StmtVisitor::Visit##FROM(FROM *Node) { Visit##TO(Node); }
+#include "clang/AST/StmtNodes.def"
 
-DELEGATE_VISITOR(Expr, Stmt)
-
-// Stmt subclasses to Stmt.
-DELEGATE_VISITOR(CompoundStmt, Stmt)
-DELEGATE_VISITOR(IfStmt      , Stmt)
-DELEGATE_VISITOR(WhileStmt   , Stmt)
-DELEGATE_VISITOR(DoStmt      , Stmt)
-DELEGATE_VISITOR(ForStmt     , Stmt)
-DELEGATE_VISITOR(ReturnStmt  , Stmt)
-
-// Expr subclasses to Expr.
-DELEGATE_VISITOR(DeclRefExpr          , Expr)
-DELEGATE_VISITOR(IntegerConstant      , Expr)
-DELEGATE_VISITOR(FloatingConstant     , Expr)
-DELEGATE_VISITOR(StringExpr           , Expr)
-DELEGATE_VISITOR(ParenExpr            , Expr)
-DELEGATE_VISITOR(UnaryOperator        , Expr)
-DELEGATE_VISITOR(SizeOfAlignOfTypeExpr, Expr)
-DELEGATE_VISITOR(ArraySubscriptExpr   , Expr)
-DELEGATE_VISITOR(CallExpr             , Expr)
-DELEGATE_VISITOR(MemberExpr           , Expr)
-DELEGATE_VISITOR(CastExpr             , Expr)
-DELEGATE_VISITOR(BinaryOperator       , Expr)
-DELEGATE_VISITOR(ConditionalOperator  , Expr)

Modified: cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=39117&r1=39116&r2=39117&view=diff

==============================================================================
--- cfe/cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/cfe/trunk/clang.xcodeproj/project.pbxproj Wed Jul 11 11:27:41 2007
@@ -124,7 +124,7 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-		8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
+		8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
 		DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = "<group>"; };
 		DE06BECA0A854E4B0050E87E /* Scope.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Scope.h; path = clang/Parse/Scope.h; sourceTree = "<group>"; };
 		DE06CC170A899E110050E87E /* Statement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Statement.cpp; path = Parse/Statement.cpp; sourceTree = "<group>"; };

Added: cfe/cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/StmtNodes.def?rev=39117&view=auto

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/StmtNodes.def (added)
+++ cfe/cfe/trunk/include/clang/AST/StmtNodes.def Wed Jul 11 11:27:41 2007
@@ -0,0 +1,38 @@
+//===-- StmtNodes.def - Metadata about Stmt AST nodes -----------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file defines the AST Node info database.
+//
+//===----------------------------------------------------------------------===//
+
+// Normal Statements.
+STMT(CompoundStmt, Stmt)
+STMT(IfStmt      , Stmt)
+STMT(WhileStmt   , Stmt)
+STMT(DoStmt      , Stmt)
+STMT(ForStmt     , Stmt)
+STMT(ReturnStmt  , Stmt)
+
+// Expressions.
+STMT(Expr                 , Stmt)
+STMT(DeclRefExpr          , Expr)
+STMT(IntegerConstant      , Expr)
+STMT(FloatingConstant     , Expr)
+STMT(StringExpr           , Expr)
+STMT(ParenExpr            , Expr)
+STMT(UnaryOperator        , Expr)
+STMT(SizeOfAlignOfTypeExpr, Expr)
+STMT(ArraySubscriptExpr   , Expr)
+STMT(CallExpr             , Expr)
+STMT(MemberExpr           , Expr)
+STMT(CastExpr             , Expr)
+STMT(BinaryOperator       , Expr)
+STMT(ConditionalOperator  , Expr)
+
+#undef STMT
\ No newline at end of file

Propchange: cfe/cfe/trunk/include/clang/AST/StmtNodes.def

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/include/clang/AST/StmtNodes.def

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision





More information about the cfe-commits mailing list