MLIR  20.0.0git
Typedefs | Functions
mlir::detail::pass_options Namespace Reference

Typedefs

template<typename T >
using has_stream_operator_trait = decltype(std::declval< raw_ostream & >()<< std::declval< T >())
 Trait used to detect if a type has a operator<< method. More...
 
template<typename T >
using has_stream_operator = llvm::is_detected< has_stream_operator_trait, T >
 

Functions

LogicalResult parseCommaSeparatedList (llvm::cl::Option &opt, StringRef argName, StringRef optionStr, function_ref< LogicalResult(StringRef)> elementParseFn)
 Parse a string containing a list of comma-delimited elements, invoking the given parser for each sub-element and passing them to the provided element-append functor. More...
 
template<typename ElementParser , typename ElementAppendFn >
LogicalResult parseCommaSeparatedList (llvm::cl::Option &opt, StringRef argName, StringRef optionStr, ElementParser &elementParser, ElementAppendFn &&appendFn)
 
template<typename ParserT >
static void printOptionValue (raw_ostream &os, const bool &value)
 Utility methods for printing option values. More...
 
template<typename ParserT >
static void printOptionValue (raw_ostream &os, const std::string &str)
 
template<typename ParserT , typename DataT >
static std::enable_if_t< has_stream_operator< DataT >::value > printOptionValue (raw_ostream &os, const DataT &value)
 
template<typename ParserT , typename DataT >
static std::enable_if_t<!has_stream_operator< DataT >::value > printOptionValue (raw_ostream &os, const DataT &value)
 

Typedef Documentation

◆ has_stream_operator

template<typename T >
using mlir::detail::pass_options::has_stream_operator = typedef llvm::is_detected<has_stream_operator_trait, T>

Definition at line 56 of file PassOptions.h.

◆ has_stream_operator_trait

template<typename T >
using mlir::detail::pass_options::has_stream_operator_trait = typedef decltype(std::declval<raw_ostream &>() << std::declval<T>())

Trait used to detect if a type has a operator<< method.

Definition at line 53 of file PassOptions.h.

Function Documentation

◆ parseCommaSeparatedList() [1/2]

template<typename ElementParser , typename ElementAppendFn >
LogicalResult mlir::detail::pass_options::parseCommaSeparatedList ( llvm::cl::Option &  opt,
StringRef  argName,
StringRef  optionStr,
ElementParser &  elementParser,
ElementAppendFn &&  appendFn 
)

Definition at line 37 of file PassOptions.h.

References parseCommaSeparatedList().

◆ parseCommaSeparatedList() [2/2]

LogicalResult mlir::detail::pass_options::parseCommaSeparatedList ( llvm::cl::Option &  opt,
StringRef  argName,
StringRef  optionStr,
function_ref< LogicalResult(StringRef)>  elementParseFn 
)

Parse a string containing a list of comma-delimited elements, invoking the given parser for each sub-element and passing them to the provided element-append functor.

Definition at line 214 of file PassRegistry.cpp.

References extractArgAndUpdateOptions().

Referenced by mlir::detail::PassOptions::ListOption< DataType, OptionParser >::handleOccurrence(), llvm::cl::detail::VectorParserBase< VectorT, ElementT >::parse(), parseCommaSeparatedList(), and mlir::AsmParser::parseTypeList().

◆ printOptionValue() [1/4]

template<typename ParserT >
static void mlir::detail::pass_options::printOptionValue ( raw_ostream &  os,
const bool &  value 
)
static

Utility methods for printing option values.

Definition at line 60 of file PassOptions.h.

Referenced by llvm::cl::detail::VectorParserBase< VectorT, ElementT >::print().

◆ printOptionValue() [2/4]

template<typename ParserT , typename DataT >
static std::enable_if_t<has_stream_operator<DataT>::value> mlir::detail::pass_options::printOptionValue ( raw_ostream &  os,
const DataT &  value 
)
static

Definition at line 79 of file PassOptions.h.

◆ printOptionValue() [3/4]

template<typename ParserT , typename DataT >
static std::enable_if_t<!has_stream_operator<DataT>::value> mlir::detail::pass_options::printOptionValue ( raw_ostream &  os,
const DataT &  value 
)
static

Definition at line 84 of file PassOptions.h.

References print().

◆ printOptionValue() [4/4]

template<typename ParserT >
static void mlir::detail::pass_options::printOptionValue ( raw_ostream &  os,
const std::string &  str 
)
static

Definition at line 64 of file PassOptions.h.

References min().