[PATCH] Enhancements for the DynTypedNode/DynTypedMatcher system.

Samuel Benzaquen sbenza at google.com
Fri May 17 14:59:15 PDT 2013



================
Comment at: include/clang/AST/ASTTypeTraits.h:28-33
@@ +27,8 @@
+/// \brief Forward declare the types to be used below.
+#define DECL(DERIVED, BASE) class DERIVED##Decl;
+#include "clang/AST/DeclNodes.inc"
+#define STMT(DERIVED, BASE) class DERIVED;
+#include "clang/AST/StmtNodes.inc"
+#define TYPE(DERIVED, BASE) class DERIVED##Type;
+#include "clang/AST/TypeNodes.def"
+
----------------
Dmitri Gribenko wrote:
> Maybe this could be pulled into clang/AST/ASTFwd.h?  It could probably be used in a lot of other places...
> 
> But this file already includes clang/AST/Decl.h, so why are these forward declarations needed?
Moved them to their own file.
We need the forward declarations because there are many node types not declared in Decl.h, like stuff from DeclCXX.h.

Some headers are needed here, since some of the node types are handled by value in DynTypedNode below.


http://llvm-reviews.chandlerc.com/D815



More information about the cfe-commits mailing list