MLIR  20.0.0git
Classes | Enumerations | Functions
mlir::query::matcher::internal Namespace Reference

Classes

struct  SourceLocation
 
struct  SourceRange
 
struct  ArgTypeTraits
 
struct  ArgTypeTraits< const T & >
 
struct  ArgTypeTraits< llvm::StringRef >
 
struct  ArgTypeTraits< DynMatcher >
 
class  MatcherDescriptor
 
class  FixedArgCountMatcherDescriptor
 
class  Diagnostics
 
class  Parser
 

Enumerations

enum class  ErrorType {
  None , ParserChainedExprInvalidArg , ParserChainedExprNoCloseParen , ParserChainedExprNoOpenParen ,
  ParserFailedToBuildMatcher , ParserInvalidToken , ParserMalformedChainedExpr , ParserNoCloseParen ,
  ParserNoCode , ParserNoComma , ParserNoOpenParen , ParserNotAMatcher ,
  ParserOverloadedType , ParserStringError , ParserTrailingCode , RegistryMatcherNotFound ,
  RegistryNotBindable , RegistryValueNotFound , RegistryWrongArgCount , RegistryWrongArgType
}
 

Functions

void addError (Diagnostics *error, SourceRange range, ErrorType errorType, std::initializer_list< llvm::Twine > errorTexts)
 
bool checkArgCount (SourceRange nameRange, size_t expectedArgCount, llvm::ArrayRef< ParserValue > args, Diagnostics *error)
 
template<typename ArgType , size_t Index>
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< MatcherDescriptormakeMatcherAutoMarshall (ReturnType(*matcherFunc)(ArgTypes...), llvm::StringRef matcherName)
 
static llvm::StringRef errorTypeToFormatString (ErrorType type)
 
static void formatErrorString (llvm::StringRef formatString, llvm::ArrayRef< std::string > args, llvm::raw_ostream &os)
 
static void maybeAddLineAndColumn (SourceRange range, llvm::raw_ostream &os)
 

Enumeration Type Documentation

◆ ErrorType

Enumerator
None 
ParserChainedExprInvalidArg 
ParserChainedExprNoCloseParen 
ParserChainedExprNoOpenParen 
ParserFailedToBuildMatcher 
ParserInvalidToken 
ParserMalformedChainedExpr 
ParserNoCloseParen 
ParserNoCode 
ParserNoComma 
ParserNoOpenParen 
ParserNotAMatcher 
ParserOverloadedType 
ParserStringError 
ParserTrailingCode 
RegistryMatcherNotFound 
RegistryNotBindable 
RegistryValueNotFound 
RegistryWrongArgCount 
RegistryWrongArgType 

Definition at line 36 of file ErrorBuilder.h.

Function Documentation

◆ addError()

void mlir::query::matcher::internal::addError ( Diagnostics error,
SourceRange  range,
ErrorType  errorType,
std::initializer_list< llvm::Twine >  errorTexts 
)

◆ checkArgCount()

bool mlir::query::matcher::internal::checkArgCount ( SourceRange  nameRange,
size_t  expectedArgCount,
llvm::ArrayRef< ParserValue args,
Diagnostics error 
)
inline

Definition at line 127 of file Marshallers.h.

References addError(), and RegistryWrongArgCount.

Referenced by matcherMarshallFixedImpl().

◆ checkArgTypeAtIndex()

template<typename ArgType , size_t Index>
bool mlir::query::matcher::internal::checkArgTypeAtIndex ( llvm::StringRef  matcherName,
llvm::ArrayRef< ParserValue args,
Diagnostics error 
)
inline

Definition at line 140 of file Marshallers.h.

References addError(), and RegistryWrongArgType.

◆ errorTypeToFormatString()

static llvm::StringRef mlir::query::matcher::internal::errorTypeToFormatString ( ErrorType  type)
static

◆ formatErrorString()

static void mlir::query::matcher::internal::formatErrorString ( llvm::StringRef  formatString,
llvm::ArrayRef< std::string >  args,
llvm::raw_ostream &  os 
)
static

Definition at line 79 of file Diagnostics.cpp.

◆ makeMatcherAutoMarshall()

template<typename ReturnType , typename... ArgTypes>
std::unique_ptr<MatcherDescriptor> mlir::query::matcher::internal::makeMatcherAutoMarshall ( ReturnType(*)(ArgTypes...)  matcherFunc,
llvm::StringRef  matcherName 
)

Definition at line 188 of file Marshallers.h.

Referenced by mlir::query::matcher::Registry::registerMatcher().

◆ matcherMarshallFixed()

template<typename ReturnType , typename... ArgTypes>
static VariantMatcher mlir::query::matcher::internal::matcherMarshallFixed ( void(*)()  matcherFunc,
llvm::StringRef  matcherName,
SourceRange  nameRange,
llvm::ArrayRef< ParserValue args,
Diagnostics error 
)
static

Definition at line 177 of file Marshallers.h.

References matcherMarshallFixedImpl().

◆ matcherMarshallFixedImpl()

template<typename ReturnType , typename... ArgTypes, size_t... Is>
static VariantMatcher mlir::query::matcher::internal::matcherMarshallFixedImpl ( void(*)()  matcherFunc,
llvm::StringRef  matcherName,
SourceRange  nameRange,
llvm::ArrayRef< ParserValue args,
Diagnostics error,
std::index_sequence< Is... >   
)
static

◆ maybeAddLineAndColumn()

static void mlir::query::matcher::internal::maybeAddLineAndColumn ( SourceRange  range,
llvm::raw_ostream &  os 
)
static