Deleted Added
full compact
DeclVisitor.h (208954) DeclVisitor.h (210299)
1//===--- DeclVisitor.h - Visitor for Decl 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//===----------------------------------------------------------------------===//

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

25 return static_cast<ImplClass*>(this)-> Visit##NAME(static_cast<CLASS*>(D))
26
27/// \brief A simple visitor class that helps create declaration visitors.
28template<typename ImplClass, typename RetTy=void>
29class DeclVisitor {
30public:
31 RetTy Visit(Decl *D) {
32 switch (D->getKind()) {
1//===--- DeclVisitor.h - Visitor for Decl 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//===----------------------------------------------------------------------===//

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

25 return static_cast<ImplClass*>(this)-> Visit##NAME(static_cast<CLASS*>(D))
26
27/// \brief A simple visitor class that helps create declaration visitors.
28template<typename ImplClass, typename RetTy=void>
29class DeclVisitor {
30public:
31 RetTy Visit(Decl *D) {
32 switch (D->getKind()) {
33 default: assert(false && "Decl that isn't part of DeclNodes.def!");
34#define DECL(Derived, Base) \
35 case Decl::Derived: DISPATCH(Derived##Decl, Derived##Decl);
36#define ABSTRACT_DECL(Derived, Base)
37#include "clang/AST/DeclNodes.def"
33 default: assert(false && "Decl that isn't part of DeclNodes.inc!");
34#define DECL(DERIVED, BASE) \
35 case Decl::DERIVED: DISPATCH(DERIVED##Decl, DERIVED##Decl);
36#define ABSTRACT_DECL(DECL)
37#include "clang/AST/DeclNodes.inc"
38 }
39 }
40
41 // If the implementation chooses not to implement a certain visit
42 // method, fall back to the parent.
38 }
39 }
40
41 // If the implementation chooses not to implement a certain visit
42 // method, fall back to the parent.
43#define DECL(Derived, Base) \
44 RetTy Visit##Derived##Decl(Derived##Decl *D) { DISPATCH(Base, Base); }
45#define ABSTRACT_DECL(Derived, Base) DECL(Derived, Base)
46#include "clang/AST/DeclNodes.def"
43#define DECL(DERIVED, BASE) \
44 RetTy Visit##DERIVED##Decl(DERIVED##Decl *D) { DISPATCH(BASE, BASE); }
45#include "clang/AST/DeclNodes.inc"
47
48 RetTy VisitDecl(Decl *D) { return RetTy(); }
49};
50
51#undef DISPATCH
52
53} // end namespace clang
54
55#endif // LLVM_CLANG_AST_DECLVISITOR_H
46
47 RetTy VisitDecl(Decl *D) { return RetTy(); }
48};
49
50#undef DISPATCH
51
52} // end namespace clang
53
54#endif // LLVM_CLANG_AST_DECLVISITOR_H