MLIR  20.0.0git
Public Member Functions | Protected Member Functions | List of all members
mlir::DialectExtensionBase Class Referenceabstract

This class represents an opaque dialect extension. More...

#include "mlir/IR/DialectRegistry.h"

+ Inheritance diagram for mlir::DialectExtensionBase:

Public Member Functions

virtual ~DialectExtensionBase ()
 
ArrayRef< StringRef > getRequiredDialects () const
 Return the dialects that our required by this extension to be loaded before applying. More...
 
virtual void apply (MLIRContext *context, MutableArrayRef< Dialect * > dialects) const =0
 Apply this extension to the given context and the required dialects. More...
 
virtual std::unique_ptr< DialectExtensionBaseclone () const =0
 Return a copy of this extension. More...
 

Protected Member Functions

 DialectExtensionBase (ArrayRef< StringRef > dialectNames)
 Initialize the extension with a set of required dialects. More...
 

Detailed Description

This class represents an opaque dialect extension.

It contains a set of required dialects and an application function. The required dialects control when the extension is applied, i.e. the extension is applied when all required dialects are loaded. The application function can be used to attach additional functionality to attributes, dialects, operations, types, etc., and may also load additional necessary dialects.

Definition at line 42 of file DialectRegistry.h.

Constructor & Destructor Documentation

◆ ~DialectExtensionBase()

DialectExtensionBase::~DialectExtensionBase ( )
virtualdefault

◆ DialectExtensionBase()

mlir::DialectExtensionBase::DialectExtensionBase ( ArrayRef< StringRef >  dialectNames)
inlineprotected

Initialize the extension with a set of required dialects.

If the list is empty, the extension is invoked for every loaded dialect independently.

Definition at line 62 of file DialectRegistry.h.

Member Function Documentation

◆ apply()

virtual void mlir::DialectExtensionBase::apply ( MLIRContext context,
MutableArrayRef< Dialect * >  dialects 
) const
pure virtual

Apply this extension to the given context and the required dialects.

Implemented in mlir::DialectExtension< DerivedT, DialectsT >, and mlir::DialectExtension< DerivedTy, TransformDialect, ExtraDialects... >.

◆ clone()

virtual std::unique_ptr<DialectExtensionBase> mlir::DialectExtensionBase::clone ( ) const
pure virtual

◆ getRequiredDialects()

ArrayRef<StringRef> mlir::DialectExtensionBase::getRequiredDialects ( ) const
inline

Return the dialects that our required by this extension to be loaded before applying.

If empty then the extension is invoked for every loaded dialect indepently.

Definition at line 49 of file DialectRegistry.h.


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