13 #ifndef MLIR_TOOLS_PLUGINS_DIALECTPLUGIN_H
14 #define MLIR_TOOLS_PLUGINS_DIALECTPLUGIN_H
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Support/Compiler.h"
20 #include "llvm/Support/DynamicLibrary.h"
21 #include "llvm/Support/Error.h"
80 const llvm::sys::DynamicLibrary &library)
81 : filename(filename), library(library), info() {}
84 llvm::sys::DynamicLibrary library;
85 DialectPluginLibraryInfo info;
::mlir::DialectPluginLibraryInfo LLVM_ATTRIBUTE_WEAK mlirGetDialectPluginInfo()
The public entry point for a dialect plugin.
static llvm::Expected< DialectPlugin > load(const std::string &filename)
Attempts to load a dialect plugin from a given file.
uint32_t getAPIVersion() const
Get the plugin API version.
StringRef getFilename() const
Get the filename of the loaded plugin.
void registerDialectRegistryCallbacks(DialectRegistry &dialectRegistry) const
Invoke the DialectRegistry callback registration.
StringRef getPluginName() const
Get the plugin name.
StringRef getPluginVersion() const
Get the plugin version.
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Include the generated interface declarations.
Information about the plugin required to load its dialects & passes.
const char * pluginName
A meaningful name of the plugin.
const char * pluginVersion
The version of the plugin.
uint32_t apiVersion
The API version understood by this plugin, usually MLIR_PLUGIN_API_VERSION.
void(* registerDialectRegistryCallbacks)(DialectRegistry *)
The callback for registering dialect plugin with a DialectRegistry instance.