13 #ifndef MLIR_TOOLS_PLUGINS_PASSPLUGIN_H
14 #define MLIR_TOOLS_PLUGINS_PASSPLUGIN_H
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/Compiler.h"
19 #include "llvm/Support/DynamicLibrary.h"
20 #include "llvm/Support/Error.h"
32 #define MLIR_PLUGIN_API_VERSION 1
86 const llvm::sys::DynamicLibrary &library)
87 : filename(filename), library(library), info() {}
90 llvm::sys::DynamicLibrary library;
91 PassPluginLibraryInfo info;
::mlir::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK mlirGetPassPluginInfo()
The public entry point for a pass plugin.
void registerPassRegistryCallbacks() const
Invoke the PassRegistry callback registration.
StringRef getFilename() const
Get the filename of the loaded plugin.
uint32_t getAPIVersion() const
Get the plugin API version.
StringRef getPluginVersion() const
Get the plugin version.
StringRef getPluginName() const
Get the plugin name.
static llvm::Expected< PassPlugin > load(const std::string &filename)
Attempts to load a pass plugin from a given file.
Include the generated interface declarations.
Information about the plugin required to load its passes.
const char * pluginVersion
The version of the plugin.
uint32_t apiVersion
The API version understood by this plugin, usually MLIR_PLUGIN_API_VERSION.
const char * pluginName
A meaningful name of the plugin.
void(* registerPassRegistryCallbacks)()
The callback for registering plugin passes.