Deleted Added
full compact
TypeVisitor.h (198092) TypeVisitor.h (208600)
1//===--- TypeVisitor.h - Visitor for Stmt subclasses ------------*- C++ -*-===//
1//===--- TypeVisitor.h - Visitor for Type subclasses ------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//

--- 10 unchanged lines hidden (view full) ---

20
21#define DISPATCH(CLASS) \
22 return static_cast<ImplClass*>(this)->Visit ## CLASS(static_cast<CLASS*>(T))
23
24template<typename ImplClass, typename RetTy=void>
25class TypeVisitor {
26public:
27 RetTy Visit(Type *T) {
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//

--- 10 unchanged lines hidden (view full) ---

20
21#define DISPATCH(CLASS) \
22 return static_cast<ImplClass*>(this)->Visit ## CLASS(static_cast<CLASS*>(T))
23
24template<typename ImplClass, typename RetTy=void>
25class TypeVisitor {
26public:
27 RetTy Visit(Type *T) {
28 // Top switch stmt: dispatch to VisitFooStmt for each FooStmt.
28 // Top switch stmt: dispatch to VisitFooType for each FooType.
29 switch (T->getTypeClass()) {
30 default: assert(0 && "Unknown type class!");
31#define ABSTRACT_TYPE(CLASS, PARENT)
32#define TYPE(CLASS, PARENT) case Type::CLASS: DISPATCH(CLASS##Type);
33#include "clang/AST/TypeNodes.def"
34 }
35 }
36

--- 16 unchanged lines hidden ---
29 switch (T->getTypeClass()) {
30 default: assert(0 && "Unknown type class!");
31#define ABSTRACT_TYPE(CLASS, PARENT)
32#define TYPE(CLASS, PARENT) case Type::CLASS: DISPATCH(CLASS##Type);
33#include "clang/AST/TypeNodes.def"
34 }
35 }
36

--- 16 unchanged lines hidden ---