MLIR 22.0.0git
mlir::OpAsmDialectInterface Class Reference

#include "mlir/IR/OpImplementation.h"

Inheritance diagram for mlir::OpAsmDialectInterface:

Public Types

using AliasResult = OpAsmAliasResult
Public Types inherited from mlir::detail::DialectInterfaceBase< ConcreteType, DialectInterface >
using Base
Public Types inherited from mlir::DialectInterface
template<typename ConcreteType>
using Base = detail::DialectInterfaceBase<ConcreteType, DialectInterface>
 The base class used for all derived interface types.

Public Member Functions

 OpAsmDialectInterface (Dialect *dialect)
virtual AliasResult getAlias (Attribute attr, raw_ostream &os) const
 Hooks for getting an alias identifier alias for a given symbol, that is not necessarily a part of this dialect.
virtual AliasResult getAlias (Type type, raw_ostream &os) const
virtual FailureOr< AsmDialectResourceHandledeclareResource (StringRef key) const
 Declare a resource with the given key, returning a handle to use for any references of this resource key within the IR during parsing.
virtual std::string getResourceKey (const AsmDialectResourceHandle &handle) const
 Return a key to use for the given resource.
virtual LogicalResult parseResource (AsmParsedResourceEntry &entry) const
 Hook for parsing resource entries.
virtual void buildResources (Operation *op, const SetVector< AsmDialectResourceHandle > &referencedResources, AsmResourceBuilder &builder) const
 Hook for building resources to use during printing.
Public Member Functions inherited from mlir::DialectInterface
virtual ~DialectInterface ()
DialectgetDialect () const
 Return the dialect that this interface represents.
MLIRContextgetContext () const
 Return the context that holds the parent dialect of this interface.
TypeID getID () const
 Return the derived interface id.

Additional Inherited Members

Static Public Member Functions inherited from mlir::detail::DialectInterfaceBase< ConcreteType, DialectInterface >
static TypeID getInterfaceID ()
 Get a unique id for the derived interface type.
Protected Member Functions inherited from mlir::detail::DialectInterfaceBase< ConcreteType, DialectInterface >
 DialectInterfaceBase (Dialect *dialect)
Protected Member Functions inherited from mlir::DialectInterface
 DialectInterface (Dialect *dialect, TypeID id)

Detailed Description

Definition at line 1784 of file OpImplementation.h.

Member Typedef Documentation

◆ AliasResult

Constructor & Destructor Documentation

◆ OpAsmDialectInterface()

mlir::OpAsmDialectInterface::OpAsmDialectInterface ( Dialect * dialect)
inline

Definition at line 1787 of file OpImplementation.h.

Member Function Documentation

◆ buildResources()

virtual void mlir::OpAsmDialectInterface::buildResources ( Operation * op,
const SetVector< AsmDialectResourceHandle > & referencedResources,
AsmResourceBuilder & builder ) const
inlinevirtual

Hook for building resources to use during printing.

The given op may be inspected to help determine what information to include. referencedResources contains all of the resources detected when printing 'op'.

Definition at line 1833 of file OpImplementation.h.

◆ declareResource()

virtual FailureOr< AsmDialectResourceHandle > mlir::OpAsmDialectInterface::declareResource ( StringRef key) const
inlinevirtual

Declare a resource with the given key, returning a handle to use for any references of this resource key within the IR during parsing.

The result of getResourceKey on the returned handle is permitted to be different than key.

Definition at line 1811 of file OpImplementation.h.

Referenced by mlir::detail::Parser::parseResourceHandle().

◆ getAlias() [1/2]

virtual AliasResult mlir::OpAsmDialectInterface::getAlias ( Attribute attr,
raw_ostream & os ) const
inlinevirtual

Hooks for getting an alias identifier alias for a given symbol, that is not necessarily a part of this dialect.

The identifier is used in place of the symbol when printing textual IR. These aliases must not contain . or end with a numeric digit([0-9]+).

Definition at line 1795 of file OpImplementation.h.

References mlir::AliasResult::NoAlias.

◆ getAlias() [2/2]

virtual AliasResult mlir::OpAsmDialectInterface::getAlias ( Type type,
raw_ostream & os ) const
inlinevirtual

Definition at line 1798 of file OpImplementation.h.

References mlir::AliasResult::NoAlias.

◆ getResourceKey()

virtual std::string mlir::OpAsmDialectInterface::getResourceKey ( const AsmDialectResourceHandle & handle) const
inlinevirtual

Return a key to use for the given resource.

This key should uniquely identify this resource within the dialect.

Definition at line 1818 of file OpImplementation.h.

Referenced by mlir::detail::Parser::parseResourceHandle().

◆ parseResource()

LogicalResult OpAsmDialectInterface::parseResource ( AsmParsedResourceEntry & entry) const
virtual

Hook for parsing resource entries.

The OpAsmOpInterface, see OpAsmInterface.td for more details.

Returns failure if the entry was not valid, or could otherwise not be processed correctly. Any necessary errors can be emitted via the provided entry.

Definition at line 132 of file AsmPrinter.cpp.

References mlir::AsmParsedResourceEntry::emitError(), mlir::DialectInterface::getDialect(), mlir::AsmParsedResourceEntry::getKey(), and mlir::Dialect::getNamespace().


The documentation for this class was generated from the following files: