1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef CustomAttributes_h__
6 #define CustomAttributes_h__
8 #include "clang/AST/DeclBase.h"
9 #include "llvm/ADT/StringRef.h"
11 enum CustomAttributes
{
13 #include "CustomAttributes.inc"
14 #include "external/CustomAttributes.inc"
18 struct CustomAttributesSet
{
19 #define ATTR(a) bool has_##a : 1;
20 #include "CustomAttributes.inc"
21 #include "external/CustomAttributes.inc"
25 template <CustomAttributes A
> bool hasCustomAttribute(const clang::Decl
*D
) {
29 extern CustomAttributesSet
GetAttributes(const clang::Decl
*D
);
32 template <> inline bool hasCustomAttribute<name>(const clang::Decl *D) { \
33 return GetAttributes(D).has_##name; \
35 #include "CustomAttributes.inc"
36 #include "external/CustomAttributes.inc"
39 extern bool hasCustomAttribute(const clang::Decl
*D
, CustomAttributes A
);
41 #endif /* CustomAttributes_h__ */