MLIR 22.0.0git
mlir::detail::pass_options Namespace Reference

Typedefs

template<typename T>
using has_stream_operator_trait
 Trait used to detect if a type has a operator<< method.
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.
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.
template<typename ParserT>
static void printOptionValue (raw_ostream &os, const std::string &str)
template<typename ParserT, typename DataT>
static void printOptionValue (raw_ostream &os, const DataT &value)

Typedef Documentation

◆ has_stream_operator

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

Definition at line 56 of file PassOptions.h.

◆ has_stream_operator_trait

Initial value:
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(), and success().

◆ 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 246 of file PassRegistry.cpp.

References extractArgAndUpdateOptions(), findChar(), and success().

Referenced by mlir::detail::PassOptions::ListOption< DataType, OptionParser >::handleOccurrence(), and parseCommaSeparatedList().

◆ printOptionValue() [1/3]

template<typename ParserT>
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.

◆ printOptionValue() [2/3]

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

Definition at line 78 of file PassOptions.h.

◆ printOptionValue() [3/3]

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

Definition at line 64 of file PassOptions.h.