MLIR  16.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 40 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.

Note that there should always be at least one affected dialect.

Definition at line 58 of file DialectRegistry.h.

Member Function Documentation

◆ apply()

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

◆ 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.

Definition at line 46 of file DialectRegistry.h.

References apply(), and clone().


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