14 #ifndef MLIR_IR_DIALECTIMPLEMENTATION_H 15 #define MLIR_IR_DIALECTIMPLEMENTATION_H 47 virtual StringRef getFullSymbolSpec()
const = 0;
57 template <
typename T,
typename = T>
61 template <
typename AttributeT>
63 AttributeT, std::enable_if_t<std::is_base_of<Attribute, AttributeT>::value,
74 template <
typename TypeT>
76 TypeT, std::enable_if_t<std::is_base_of<Type, TypeT>::value, TypeT>> {
86 template <
typename IntT>
88 std::enable_if_t<std::is_integral<IntT>::value, IntT>> {
109 template <
typename ContainerT>
111 ContainerT, std::enable_if_t<std::is_member_function_pointer<
112 decltype(&ContainerT::push_back)>::value,
117 auto elementParser = [&]() {
121 elements.push_back(element.getValue());
132 #endif // MLIR_IR_DIALECTIMPLEMENTATION_H Include the generated interface declarations.
~DialectAsmPrinter() override
typename ContainerT::value_type ElementT
static FailureOr< TypeT > parse(AsmParser &parser)
virtual ParseResult parseCommaSeparatedList(Delimiter delimiter, function_ref< ParseResult()> parseElementFn, StringRef contextMessage=StringRef())=0
Parse a list of comma-separated items with an optional delimiter.
ParseResult parseInteger(IntT &result)
Parse an integer value from the stream.
bool failed(LogicalResult result)
Utility function that returns true if the provided LogicalResult corresponds to a failure value...
virtual ParseResult parseCustomAttributeWithFallback(Attribute &result, Type type, function_ref< ParseResult(Attribute &result, Type type)> parseAttribute)=0
Parse a custom attribute with the provided callback, unless the next token is #, in which case the ge...
static constexpr const bool value
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
LogicalResult failure(bool isFailure=true)
Utility function to generate a LogicalResult.
This class provides support for representing a failure result, or a valid value of type T...
static FailureOr< IntT > parse(AsmParser &parser)
static FailureOr< AttributeT > parse(AsmParser &parser)
ParseResult parseString(std::string *string)
Parse a quoted string token.
This base class exposes generic asm parser hooks, usable across the various derived parsers...
static FailureOr< ContainerT > parse(AsmParser &parser)
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
Provide a template class that can be specialized by users to dispatch to parsers. ...
AsmPrinter()
Initialize the printer with no internal implementation.
This base class exposes generic asm printer hooks, usable across the various derived printers...
virtual ParseResult parseCustomTypeWithFallback(Type &result, function_ref< ParseResult(Type &result)> parseType)=0
Parse a custom type with the provided callback, unless the next token is #, in which case the generic...
The DialectAsmParser has methods for interacting with the asm parser when parsing attributes and type...
static FailureOr< std::string > parse(AsmParser &parser)