MLIR  20.0.0git
Classes | Namespaces | Macros | Functions
PassPlugin.h File Reference
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <string>

Go to the source code of this file.

Classes

struct  mlir::PassPluginLibraryInfo
 Information about the plugin required to load its passes. More...
 
class  mlir::PassPlugin
 A loaded pass plugin. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 

Macros

#define MLIR_PLUGIN_API_VERSION   1
 \macro MLIR_PLUGIN_API_VERSION Identifies the API version understood by this plugin. More...
 

Functions

::mlir::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK mlirGetPassPluginInfo ()
 The public entry point for a pass plugin. More...
 

Macro Definition Documentation

◆ MLIR_PLUGIN_API_VERSION

#define MLIR_PLUGIN_API_VERSION   1

\macro MLIR_PLUGIN_API_VERSION Identifies the API version understood by this plugin.

When a plugin is loaded, the driver will check it's supported plugin version against that of the plugin. A mismatch is an error. The supported version will be incremented for ABI-breaking changes to the PassPluginLibraryInfo struct, i.e. when callbacks are added, removed, or reordered.

Definition at line 32 of file PassPlugin.h.

Function Documentation

◆ mlirGetPassPluginInfo()

::mlir::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK mlirGetPassPluginInfo ( )

The public entry point for a pass plugin.

When a plugin is loaded by the driver, it will call this entry point to obtain information about this plugin and about how to register its passes. This function needs to be implemented by the plugin, see the example below:

extern "C" ::mlir::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
return {
MLIR_PLUGIN_API_VERSION, "MyPlugin", "v0.1", []() { ... }
};
}
#define MLIR_PLUGIN_API_VERSION
\macro MLIR_PLUGIN_API_VERSION Identifies the API version understood by this plugin.
Definition: PassPlugin.h:32
::mlir::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK mlirGetPassPluginInfo()
The public entry point for a pass plugin.
Information about the plugin required to load its passes.
Definition: PassPlugin.h:40

Referenced by mlir::PassPlugin::load().