LLVM 24.0.0git
llvm::PassPlugin Class Reference

A loaded pass plugin. More...

#include "llvm/Plugins/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.
const PassPluginLibraryInfo & getInfo () const
void registerPassBuilderCallbacks (PassBuilder &PB) const
 Invoke the PassBuilder callback registration.
bool invokePreCodeGenCallback (Module &M, TargetMachine &TM, CodeGenFileType CGFT, raw_pwrite_stream &OS) const
 Invoke the pre-codegen callback.

Static Public Member Functions

static LLVM_ABI Expected< PassPlugin > load (StringRef 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 77 of file PassPlugin.h.

Member Function Documentation

◆ getAPIVersion()

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

Get the plugin API version.

Definition at line 96 of file PassPlugin.h.

◆ getFilename()

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

Get the filename of the loaded plugin.

Definition at line 87 of file PassPlugin.h.

◆ getInfo()

const PassPluginLibraryInfo & llvm::PassPlugin::getInfo ( ) const
inline

Definition at line 98 of file PassPlugin.h.

◆ getPluginName()

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

Get the plugin name.

Definition at line 90 of file PassPlugin.h.

◆ getPluginVersion()

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

Get the plugin version.

Definition at line 93 of file PassPlugin.h.

◆ invokePreCodeGenCallback()

bool llvm::PassPlugin::invokePreCodeGenCallback ( Module & M,
TargetMachine & TM,
CodeGenFileType CGFT,
raw_pwrite_stream & OS ) const
inline

Invoke the pre-codegen callback.

Definition at line 107 of file PassPlugin.h.

◆ load()

Expected< PassPlugin > PassPlugin::load ( StringRef 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 18 of file PassPlugin.cpp.

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

Referenced by RegisterPassPlugins().

◆ registerPassBuilderCallbacks()

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

Invoke the PassBuilder callback registration.

Definition at line 101 of file PassPlugin.h.

References PB().

Referenced by RegisterPassPlugins().


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