LLVM  10.0.0svn
Classes | Namespaces | Macros | Functions
PassPlugin.h File Reference
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Error.h"
#include <cstdint>
#include <string>
Include dependency graph for PassPlugin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llvm::PassPluginLibraryInfo
 Information about the plugin required to load its passes. More...
 
class  llvm::PassPlugin
 A loaded pass plugin. More...
 

Namespaces

 llvm
 This class represents lattice values for constants.
 

Macros

#define LLVM_PLUGIN_API_VERSION   1
 LLVM_PLUGIN_API_VERSION Identifies the API version understood by this plugin. More...
 

Functions

::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK llvmGetPassPluginInfo ()
 The public entry point for a pass plugin. More...
 

Macro Definition Documentation

◆ LLVM_PLUGIN_API_VERSION

#define LLVM_PLUGIN_API_VERSION   1

LLVM_PLUGIN_API_VERSION Identifies the API version understood by this plugin.

When a plugin is loaded, the driver will check it's supported plugin version against that of the plugin. A mismatch is an error. The supported version will be incremented for ABI-breaking changes to the PassPluginLibraryInfo struct, i.e. when callbacks are added, removed, or reordered.

Definition at line 33 of file PassPlugin.h.

Referenced by llvm::PassPlugin::Load().

Function Documentation

◆ llvmGetPassPluginInfo()

::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK llvmGetPassPluginInfo ( )

The public entry point for a pass plugin.

When a plugin is loaded by the driver, it will call this entry point to obtain information about this plugin and about how to register its passes. This function needs to be implemented by the plugin, see the example below:

return {
LLVM_PLUGIN_API_VERSION, "MyPlugin", "v0.1", [](PassBuilder &PB) { ... }
};
}

Referenced by llvm::PassPlugin::Load().