LLVM 22.0.0git
PluginLoader.h
Go to the documentation of this file.
1//===-- llvm/Support/PluginLoader.h - Plugin Loader for Tools ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// A tool can #include this file to get a -load option that allows the user to
10// load arbitrary shared objects into the tool's address space. Note that this
11// header can only be included by a program ONCE, so it should never to used by
12// library authors.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_SUPPORT_PLUGINLOADER_H
17#define LLVM_SUPPORT_PLUGINLOADER_H
18
20
21#ifndef DONT_GET_PLUGIN_LOADER_OPTION
23#endif
24
25#include <string>
26
27namespace llvm {
28 struct PluginLoader {
29 LLVM_ABI void operator=(const std::string &Filename);
30 LLVM_ABI static unsigned getNumPlugins();
31 LLVM_ABI static std::string &getPlugin(unsigned num);
32 };
33
34#ifndef DONT_GET_PLUGIN_LOADER_OPTION
35 // This causes operator= above to be invoked for every -load option.
37 LoadOpt("load", cl::value_desc("pluginfilename"),
38 cl::desc("Load the specified plugin"));
39#endif
40}
41
42#endif
#define LLVM_ABI
Definition Compiler.h:213
This is an optimization pass for GlobalISel generic memory operations.
static cl::opt< PluginLoader, false, cl::parser< std::string > > LoadOpt("load", cl::value_desc("pluginfilename"), cl::desc("Load the specified plugin"))
static LLVM_ABI std::string & getPlugin(unsigned num)
static LLVM_ABI unsigned getNumPlugins()
LLVM_ABI void operator=(const std::string &Filename)