#ifndef MLIR_TOOLS_MLIRQUERY_MATCHER_MARSHALLERS_H
#define MLIR_TOOLS_MLIRQUERY_MATCHER_MARSHALLERS_H
#include "ErrorBuilder.h"
#include "VariantValue.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
namespace mlir::query::matcher::internal {
template <class T>
struct ArgTypeTraits;
ArgTypeTraits<const T &>;
template <>
struct ArgTypeTraits<llvm::StringRef> { … };
template <>
struct ArgTypeTraits<DynMatcher> { … };
class MatcherDescriptor { … };
class FixedArgCountMatcherDescriptor : public MatcherDescriptor { … };
inline bool checkArgCount(SourceRange nameRange, size_t expectedArgCount,
llvm::ArrayRef<ParserValue> args,
Diagnostics *error) { … }
template <typename ArgType, size_t Index>
inline bool checkArgTypeAtIndex(llvm::StringRef matcherName,
llvm::ArrayRef<ParserValue> args,
Diagnostics *error) { … }
template <typename ReturnType, typename... ArgTypes, size_t... Is>
static VariantMatcher
matcherMarshallFixedImpl(void (*matcherFunc)(), llvm::StringRef matcherName,
SourceRange nameRange,
llvm::ArrayRef<ParserValue> args, Diagnostics *error,
std::index_sequence<Is...>) { … }
template <typename ReturnType, typename... ArgTypes>
static VariantMatcher
matcherMarshallFixed(void (*matcherFunc)(), llvm::StringRef matcherName,
SourceRange nameRange, llvm::ArrayRef<ParserValue> args,
Diagnostics *error) { … }
template <typename ReturnType, typename... ArgTypes>
std::unique_ptr<MatcherDescriptor>
makeMatcherAutoMarshall(ReturnType (*matcherFunc)(ArgTypes...),
llvm::StringRef matcherName) { … }
}
#endif