LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::PassPlugin Class Reference

A loaded pass plugin. More...

#include "llvm/Passes/PassPlugin.h"

Public Member Functions

StringRef getFilename () const
 Get the filename of the loaded plugin.
 
StringRef getPluginName () const
 Get the plugin name.
 
StringRef getPluginVersion () const
 Get the plugin version.
 
uint32_t getAPIVersion () const
 Get the plugin API version.
 
void registerPassBuilderCallbacks (PassBuilder &PB) const
 Invoke the PassBuilder callback registration.
 

Static Public Member Functions

static Expected< PassPluginLoad (const std::string &Filename)
 Attempts to load a pass plugin from a given file.
 

Detailed Description

A loaded pass plugin.

An instance of this class wraps a loaded pass plugin and gives access to its interface defined by the PassPluginLibraryInfo it exposes.

Definition at line 60 of file PassPlugin.h.

Member Function Documentation

◆ getAPIVersion()

uint32_t llvm::PassPlugin::getAPIVersion ( ) const
inline

Get the plugin API version.

Definition at line 79 of file PassPlugin.h.

References llvm::PassPluginLibraryInfo::APIVersion.

◆ getFilename()

StringRef llvm::PassPlugin::getFilename ( ) const
inline

Get the filename of the loaded plugin.

Definition at line 70 of file PassPlugin.h.

◆ getPluginName()

StringRef llvm::PassPlugin::getPluginName ( ) const
inline

Get the plugin name.

Definition at line 73 of file PassPlugin.h.

References llvm::PassPluginLibraryInfo::PluginName.

◆ getPluginVersion()

StringRef llvm::PassPlugin::getPluginVersion ( ) const
inline

Get the plugin version.

Definition at line 76 of file PassPlugin.h.

References llvm::PassPluginLibraryInfo::PluginVersion.

◆ Load()

Expected< PassPlugin > PassPlugin::Load ( const std::string &  Filename)
static

Attempts to load a pass plugin from a given file.

Returns
Returns an error if either the library cannot be found or loaded, there is no public entry point, or the plugin implements the wrong API version.

Definition at line 16 of file PassPlugin.cpp.

References llvm::sys::DynamicLibrary::getAddressOfSymbol(), llvm::sys::DynamicLibrary::getPermanentLibrary(), llvm::inconvertibleErrorCode(), llvm::sys::DynamicLibrary::isValid(), LLVM_PLUGIN_API_VERSION, llvmGetPassPluginInfo(), and P.

Referenced by RegisterPassPlugins().

◆ registerPassBuilderCallbacks()

void llvm::PassPlugin::registerPassBuilderCallbacks ( PassBuilder PB) const
inline

Invoke the PassBuilder callback registration.

Definition at line 82 of file PassPlugin.h.

References PB(), and llvm::PassPluginLibraryInfo::RegisterPassBuilderCallbacks.

Referenced by RegisterPassPlugins().


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