clang: include/clang/AST/AttrVisitor.h Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_AST_ATTRVISITOR_H
14#define LLVM_CLANG_AST_ATTRVISITOR_H
15
17
19
21
22
23template <template <typename> class Ptr, typename ImplClass,
24 typename RetTy = void, class... ParamTys>
26public:
27#define PTR(CLASS) typename Ptr::type
28#define DISPATCH(NAME) \
29 return static_cast<ImplClass *>(this)->Visit##NAME(static_cast<PTR(NAME)>(A))
30
33
34#define ATTR(NAME) \
35 case attr::NAME: \
36 DISPATCH(NAME##Attr);
37#include "clang/Basic/AttrList.inc"
38 }
39 llvm_unreachable("Attr that isn't part of AttrList.inc!");
40 }
41
42
43
44#define ATTR(NAME) \
45 RetTy Visit##NAME##Attr(PTR(NAME##Attr) A) { DISPATCH(Attr); }
46#include "clang/Basic/AttrList.inc"
47
49
50#undef PTR
51#undef DISPATCH
52};
53
54}
55
56
57
58
59
60template <typename ImplClass, typename RetTy = void, typename... ParamTys>
63
64
65
66
67
68template <typename ImplClass, typename RetTy = void, typename... ParamTys>
70 : public attrvisitor::Base<llvm::make_const_ptr, ImplClass, RetTy,
71 ParamTys...> {};
72
73}
74
75#endif
#define PTR(CLASS)
Definition AttrVisitor.h:27
A simple visitor class that helps create attribute visitors.
Definition AttrVisitor.h:62
Attr - This represents one attribute.
attr::Kind getKind() const
A simple visitor class that helps create attribute visitors.
Definition AttrVisitor.h:71
A simple visitor class that helps create attribute visitors.
Definition AttrVisitor.h:25
RetTy Visit(PTR(Attr) A)
Definition AttrVisitor.h:31
RetTy VisitAttr(PTR(Attr))
Definition AttrVisitor.h:48
Definition AttrVisitor.h:20
The JSON file list parser is used to communicate input to InstallAPI.