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.
LLVM_ABI bool invokePreCodeGenCallback (TargetMachine &TM, Module &M, raw_pwrite_stream &OS, raw_pwrite_stream *DwoOS, CodeGenFileType CGFT, bool DisableVerify, bool DisableSimplifyLibCalls, const ModuleSummaryIndex *MSI, IntrusiveRefCntPtr< vfs::FileSystem > VFS) 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 97 of file PassPlugin.h.

Member Function Documentation

◆ getAPIVersion()

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

Get the plugin API version.

Definition at line 116 of file PassPlugin.h.

◆ getFilename()

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

Get the filename of the loaded plugin.

Definition at line 107 of file PassPlugin.h.

◆ getInfo()

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

Definition at line 118 of file PassPlugin.h.

◆ getPluginName()

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

Get the plugin name.

Definition at line 110 of file PassPlugin.h.

◆ getPluginVersion()

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

Get the plugin version.

Definition at line 113 of file PassPlugin.h.

◆ invokePreCodeGenCallback()

bool PassPlugin::invokePreCodeGenCallback ( TargetMachine & TM,
Module & M,
raw_pwrite_stream & OS,
raw_pwrite_stream * DwoOS,
CodeGenFileType CGFT,
bool DisableVerify,
bool DisableSimplifyLibCalls,
const ModuleSummaryIndex * MSI,
IntrusiveRefCntPtr< vfs::FileSystem > VFS ) const

Invoke the pre-codegen callback.

Keep the signature in sync with llvm::runCodeGenPipeline().

Definition at line 54 of file PassPlugin.cpp.

◆ 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 19 of file PassPlugin.cpp.

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

◆ registerPassBuilderCallbacks()

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

Invoke the PassBuilder callback registration.

Definition at line 121 of file PassPlugin.h.

References PB().


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