Bug 1857669 - Install libavcodec/libavutil for Selenium tests r=releng-reviewers...
[gecko.git] / build / clang-plugin / CustomAttributes.h
blob04c95b718425f9cd0e7f4157571d57769edb6732
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 {
12 #define ATTR(a) a,
13 #include "CustomAttributes.inc"
14 #include "external/CustomAttributes.inc"
15 #undef ATTR
18 struct CustomAttributesSet {
19 #define ATTR(a) bool has_##a : 1;
20 #include "CustomAttributes.inc"
21 #include "external/CustomAttributes.inc"
22 #undef ATTR
25 template <CustomAttributes A> bool hasCustomAttribute(const clang::Decl *D) {
26 return false;
29 extern CustomAttributesSet GetAttributes(const clang::Decl *D);
31 #define ATTR(name) \
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"
37 #undef ATTR
39 extern bool hasCustomAttribute(const clang::Decl *D, CustomAttributes A);
41 #endif /* CustomAttributes_h__ */