LLVM: lib/Support/PluginLoader.cpp Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
13#define DONT_GET_PLUGIN_LOADER_OPTION
18#include
19using namespace llvm;
20
21namespace {
22
23struct Plugins {
25 std::vectorstd::string List;
26};
27
28Plugins &getPlugins() {
29 static Plugins P;
30 return P;
31}
32
33}
34
36 auto &P = getPlugins();
38 std::string Error;
40 errs() << "Error opening '" << Filename << "': " << Error
41 << "\n -load request ignored.\n";
42 } else {
43 P.List.push_back(Filename);
44 }
45}
46
48 auto &P = getPlugins();
50 return P.List.size();
51}
52
54 auto &P = getPlugins();
56 assert(num < P.List.size() && "Asking for an out of bounds plugin");
57 return P.List[num];
58}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Lightweight error class with error context and mandatory checking.
static bool LoadLibraryPermanently(const char *Filename, std::string *ErrMsg=nullptr)
This function permanently loads the dynamic library at the given path.
SmartMutex - A mutex with a compile time constant parameter that indicates whether this mutex should ...
std::lock_guard< SmartMutex< mt_only > > SmartScopedLock
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static LLVM_ABI std::string & getPlugin(unsigned num)
Definition PluginLoader.cpp:53
static LLVM_ABI unsigned getNumPlugins()
Definition PluginLoader.cpp:47
LLVM_ABI void operator=(const std::string &Filename)
Definition PluginLoader.cpp:35