diff options
Diffstat (limited to 'include/clang/AST/TypeVisitor.h')
-rw-r--r-- | include/clang/AST/TypeVisitor.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/clang/AST/TypeVisitor.h b/include/clang/AST/TypeVisitor.h index a02e39b3f34e..19f7f42a897a 100644 --- a/include/clang/AST/TypeVisitor.h +++ b/include/clang/AST/TypeVisitor.h @@ -17,10 +17,10 @@ #include "clang/AST/Type.h" namespace clang { - + #define DISPATCH(CLASS) \ return static_cast<ImplClass*>(this)->Visit ## CLASS(static_cast<CLASS*>(T)) - + template<typename ImplClass, typename RetTy=void> class TypeVisitor { public: @@ -28,15 +28,17 @@ public: // Top switch stmt: dispatch to VisitFooStmt for each FooStmt. switch (T->getTypeClass()) { default: assert(0 && "Unknown type class!"); -#define ABSTRACT_TYPE(CLASS, PARENT) +#define ABSTRACT_TYPE(CLASS, PARENT) #define TYPE(CLASS, PARENT) case Type::CLASS: DISPATCH(CLASS##Type); #include "clang/AST/TypeNodes.def" } } - + // If the implementation chooses not to implement a certain visit method, fall // back on superclass. -#define TYPE(CLASS, PARENT) RetTy Visit##CLASS##Type(CLASS##Type *T) { DISPATCH(PARENT); } +#define TYPE(CLASS, PARENT) RetTy Visit##CLASS##Type(CLASS##Type *T) { \ + DISPATCH(PARENT); \ +} #include "clang/AST/TypeNodes.def" // Base case, ignore it. :) |