LLVM 24.0.0git
llvm::PassPluginLibraryInfo Struct Reference

Information about the plugin required to load its passes. More...

#include "llvm/Plugins/PassPlugin.h"

Public Attributes

uint32_t APIVersion
 The API version understood by this plugin, usually LLVM_PLUGIN_API_VERSION.
const char * PluginName
 A meaningful name of the plugin.
const char * PluginVersion
 The version of the plugin.
void(* RegisterPassBuilderCallbacks )(PassBuilder &) = nullptr
 The callback for registering plugin passes with a PassBuilder instance.
bool(* PreCodeGenCallback )(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) = nullptr
 Callback called before running the back-end passes on the module.
Error(* ParseArguments )(ArrayRef< const char * > Args) = nullptr
 Callback receiving the arguments given to the plugin, e.g.

Detailed Description

Information about the plugin required to load its passes.

This struct defines the core interface for pass plugins and is supposed to be filled out by plugin implementors. Unused function pointers can be set to nullptr. LLVM-side users of a plugin are expected to use the PassPlugin class below to interface with it. Hosts may invoke callbacks concurrently, e.g. for parallel ThinLTO backends, so plugins must guard any state they share between invocations.

Definition at line 53 of file PassPlugin.h.

Member Data Documentation

◆ APIVersion

uint32_t llvm::PassPluginLibraryInfo::APIVersion

The API version understood by this plugin, usually LLVM_PLUGIN_API_VERSION.

Definition at line 56 of file PassPlugin.h.

◆ ParseArguments

Error(* llvm::PassPluginLibraryInfo::ParseArguments) (ArrayRef< const char * > Args) = nullptr

Callback receiving the arguments given to the plugin, e.g.

by -plugin-arg=<PluginName>,<arg>, in order.

Definition at line 89 of file PassPlugin.h.

◆ PluginName

const char* llvm::PassPluginLibraryInfo::PluginName

A meaningful name of the plugin.

-plugin-arg=<PluginName>,<arg> passes <arg> to the plugin with this name.

Definition at line 59 of file PassPlugin.h.

◆ PluginVersion

const char* llvm::PassPluginLibraryInfo::PluginVersion

The version of the plugin.

Definition at line 61 of file PassPlugin.h.

◆ PreCodeGenCallback

bool(* llvm::PassPluginLibraryInfo::PreCodeGenCallback) (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) = nullptr

Callback called before running the back-end passes on the module.

The callback can generate code itself by writing the expected output to OS and returning true to prevent the default pipeline and further plugin callbacks from running. DwoOS behaves the same way with respect to the return value. It is null unless the .dwo contents go to a separate file.

The parameters match those of llvm::runCodeGenPipeline(), so the callback can forward them to run an LLVM-based pipeline of its own. Both signatures must be kept in lockstep.

The callback might be invoked from a worker thread, so exiting inside the callback is unsafe. Failures should be reported through the module's context instead and return false.

Definition at line 80 of file PassPlugin.h.

◆ RegisterPassBuilderCallbacks

void(* llvm::PassPluginLibraryInfo::RegisterPassBuilderCallbacks) (PassBuilder &) = nullptr

The callback for registering plugin passes with a PassBuilder instance.

Definition at line 65 of file PassPlugin.h.


The documentation for this struct was generated from the following file: