LLVM  14.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. More...
StringRef getPluginName () const
 Get the plugin name. More...
StringRef getPluginVersion () const
 Get the plugin version. More...
uint32_t getAPIVersion () const
 Get the plugin API version. More...
void registerPassBuilderCallbacks (PassBuilder &PB) const
 Invoke the PassBuilder callback registration. More...

Static Public Member Functions

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

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

Get the plugin API version.

Definition at line 79 of file PassPlugin.h.

References llvm::PassPluginLibraryInfo::APIVersion.

◆ getFilename()

StringRef llvm::PassPlugin::getFilename ( ) const

Get the filename of the loaded plugin.

Definition at line 70 of file PassPlugin.h.

◆ getPluginName()

StringRef llvm::PassPlugin::getPluginName ( ) const

Get the plugin name.

Definition at line 73 of file PassPlugin.h.

References llvm::PassPluginLibraryInfo::PluginName.

◆ getPluginVersion()

StringRef llvm::PassPlugin::getPluginVersion ( ) const

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)

Attempts to load a pass plugin from a given file.

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

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: