#ifndef LLVM_CLANG_LIB_ASTMATCHERS_DYNAMIC_MARSHALLERS_H
#define LLVM_CLANG_LIB_ASTMATCHERS_DYNAMIC_MARSHALLERS_H
#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/OperationKinds.h"
#include "clang/ASTMatchers/ASTMatchersInternal.h"
#include "clang/ASTMatchers/Dynamic/Diagnostics.h"
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
#include "clang/Basic/AttrKinds.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/TypeTraits.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Regex.h"
#include <cassert>
#include <cstddef>
#include <iterator>
#include <limits>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
namespace clang {
namespace ast_matchers {
namespace dynamic {
namespace internal {
template <class T> struct ArgTypeTraits;
ArgTypeTraits<const T &>;
template <> struct ArgTypeTraits<std::string> { … };
template <>
struct ArgTypeTraits<StringRef> : public ArgTypeTraits<std::string> { … };
ArgTypeTraits<ast_matchers::internal::Matcher<T>>;
template <> struct ArgTypeTraits<bool> { … };
template <> struct ArgTypeTraits<double> { … };
template <> struct ArgTypeTraits<unsigned> { … };
template <> struct ArgTypeTraits<attr::Kind> { … };
template <> struct ArgTypeTraits<CastKind> { … };
template <> struct ArgTypeTraits<llvm::Regex::RegexFlags> { … };
template <> struct ArgTypeTraits<OpenMPClauseKind> { … };
template <> struct ArgTypeTraits<UnaryExprOrTypeTrait> { … };
class MatcherDescriptor { … };
inline bool isRetKindConvertibleTo(ArrayRef<ASTNodeKind> RetKinds,
ASTNodeKind Kind, unsigned *Specificity,
ASTNodeKind *LeastDerivedKind) { … }
class FixedArgCountMatcherDescriptor : public MatcherDescriptor { … };
template <class PolyMatcher>
static void mergePolyMatchers(const PolyMatcher &Poly,
std::vector<DynTypedMatcher> &Out,
ast_matchers::internal::EmptyTypeList) { … }
template <class PolyMatcher, class TypeList>
static void mergePolyMatchers(const PolyMatcher &Poly,
std::vector<DynTypedMatcher> &Out, TypeList) { … }
inline VariantMatcher outvalueToVariantMatcher(const DynTypedMatcher &Matcher) { … }
template <typename T>
static VariantMatcher outvalueToVariantMatcher(const T &PolyMatcher,
typename T::ReturnTypes * =
nullptr) { … }
template <typename T>
inline void
buildReturnTypeVectorFromTypeList(std::vector<ASTNodeKind> &RetTypes) { … }
template <>
inline void
buildReturnTypeVectorFromTypeList<ast_matchers::internal::EmptyTypeList>(
std::vector<ASTNodeKind> &RetTypes) { … }
template <typename T>
struct BuildReturnTypeVector { … };
BuildReturnTypeVector<ast_matchers::internal::Matcher<T>>;
BuildReturnTypeVector<ast_matchers::internal::BindableMatcher<T>>;
template <typename ResultT, typename ArgT,
ResultT (*Func)(ArrayRef<const ArgT *>)>
VariantMatcher
variadicMatcherDescriptor(StringRef MatcherName, SourceRange NameRange,
ArrayRef<ParserValue> Args, Diagnostics *Error) { … }
class VariadicFuncMatcherDescriptor : public MatcherDescriptor { … };
class DynCastAllOfMatcherDescriptor : public VariadicFuncMatcherDescriptor { … };
#define CHECK_ARG_COUNT …
#define CHECK_ARG_TYPE …
template <typename ReturnType>
static VariantMatcher matcherMarshall0(void (*Func)(), StringRef MatcherName,
SourceRange NameRange,
ArrayRef<ParserValue> Args,
Diagnostics *Error) { … }
template <typename ReturnType, typename ArgType1>
static VariantMatcher matcherMarshall1(void (*Func)(), StringRef MatcherName,
SourceRange NameRange,
ArrayRef<ParserValue> Args,
Diagnostics *Error) { … }
template <typename ReturnType, typename ArgType1, typename ArgType2>
static VariantMatcher matcherMarshall2(void (*Func)(), StringRef MatcherName,
SourceRange NameRange,
ArrayRef<ParserValue> Args,
Diagnostics *Error) { … }
#undef CHECK_ARG_COUNT
#undef CHECK_ARG_TYPE
template <template <typename ToArg, typename FromArg> class ArgumentAdapterT,
typename FromTypes, typename ToTypes>
class AdaptativeOverloadCollector { … };
class OverloadedMatcherDescriptor : public MatcherDescriptor { … };
template <typename ReturnType>
class RegexMatcherDescriptor : public MatcherDescriptor { … };
class VariadicOperatorMatcherDescriptor : public MatcherDescriptor { … };
class MapAnyOfMatcherDescriptor : public MatcherDescriptor { … };
class MapAnyOfBuilderDescriptor : public MatcherDescriptor { … };
template <typename ReturnType>
std::unique_ptr<MatcherDescriptor>
makeMatcherAutoMarshall(ReturnType (*Func)(), StringRef MatcherName) { … }
template <typename ReturnType, typename ArgType1>
std::unique_ptr<MatcherDescriptor>
makeMatcherAutoMarshall(ReturnType (*Func)(ArgType1), StringRef MatcherName) { … }
template <typename ReturnType, typename ArgType1, typename ArgType2>
std::unique_ptr<MatcherDescriptor>
makeMatcherAutoMarshall(ReturnType (*Func)(ArgType1, ArgType2),
StringRef MatcherName) { … }
template <typename ReturnType>
std::unique_ptr<MatcherDescriptor> makeMatcherRegexMarshall(
ReturnType (*FuncFlags)(llvm::StringRef, llvm::Regex::RegexFlags),
ReturnType (*Func)(llvm::StringRef)) { … }
template <typename ResultT, typename ArgT,
ResultT (*Func)(ArrayRef<const ArgT *>)>
std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::VariadicFunction<ResultT, ArgT, Func> VarFunc,
StringRef MatcherName) { … }
template <typename BaseT, typename DerivedT>
std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::VariadicDynCastAllOfMatcher<BaseT, DerivedT>
VarFunc,
StringRef MatcherName) { … }
template <template <typename ToArg, typename FromArg> class ArgumentAdapterT,
typename FromTypes, typename ToTypes>
std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::ArgumentAdaptingMatcherFunc<ArgumentAdapterT,
FromTypes, ToTypes>,
StringRef MatcherName) { … }
template <template <typename ToArg, typename FromArg> class ArgumentAdapterT,
typename FromTypes, typename ToTypes>
template <typename FromTypeList>
inline void AdaptativeOverloadCollector<ArgumentAdapterT, FromTypes,
ToTypes>::collect(FromTypeList) { … }
template <unsigned MinCount, unsigned MaxCount>
std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::VariadicOperatorMatcherFunc<MinCount, MaxCount>
Func,
StringRef MatcherName) { … }
template <typename CladeType, typename... MatcherT>
std::unique_ptr<MatcherDescriptor> makeMatcherAutoMarshall(
ast_matchers::internal::MapAnyOfMatcherImpl<CladeType, MatcherT...>,
StringRef MatcherName) { … }
}
}
}
}
#endif