LLVM: include/llvm/Support/DynamicLibrary.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_SUPPORT_DYNAMICLIBRARY_H
14#define LLVM_SUPPORT_DYNAMICLIBRARY_H
15
17#include
18
19namespace llvm {
20
22
23namespace sys {
24
25
26
27
28
29
30
31
32
33
35
36
37
39
40
41 void *Data;
42
43public:
45
46
48
49
50 bool isValid() const { return Data != &Invalid; }
51
52
53
54
55
56
57
59
60
61
62
63
64
65
66
67
68
69
70
73
74
75
76
77
78
81
82
83
84
85
86
88 std::string *ErrMsg = nullptr) {
90 }
91
92
93
94
95
96
97
98
99
100
101
103 std::string *Err = nullptr);
104
105
106
107
108
109
110
112
114
115
116
118
120
121
123
124
126 };
128
129
130
131
132
133
134
135
137
138
142
143
144
145
146
148
149 class HandleSet;
150};
151
152}
153}
154
155#endif
StringRef - Represent a constant reference to a string, i.e.
This class provides a portable interface to dynamic libraries which also might be known as shared lib...
Definition DynamicLibrary.h:34
static LLVM_ABI DynamicLibrary getLibrary(const char *FileName, std::string *Err=nullptr)
This function loads the dynamic library at the given path, using the library load operation from the ...
static LLVM_ABI DynamicLibrary addPermanentLibrary(void *handle, std::string *errMsg=nullptr)
Registers an externally loaded library.
static LLVM_ABI void AddSymbol(StringRef symbolName, void *symbolValue)
This functions permanently adds the symbol symbolName with the value symbolValue.
void * getOSSpecificHandle() const
Return the OS specific handle value.
Definition DynamicLibrary.h:47
static bool LoadLibraryPermanently(const char *Filename, std::string *ErrMsg=nullptr)
This function permanently loads the dynamic library at the given path.
Definition DynamicLibrary.h:87
DynamicLibrary(void *data=&Invalid)
Definition DynamicLibrary.h:44
static void * SearchForAddressOfSymbol(const std::string &symbolName)
Convenience function for C++ophiles.
Definition DynamicLibrary.h:139
SearchOrdering
Definition DynamicLibrary.h:113
@ SO_LoadedLast
SO_LoadedLast - Search as SO_Linker would, then loaded libraries.
Definition DynamicLibrary.h:122
@ SO_LoadOrder
SO_LoadOrder - Or this in to search libraries in the ordered loaded.
Definition DynamicLibrary.h:125
@ SO_Linker
SO_Linker - Search as a call to dlsym(dlopen(NULL)) would when DynamicLibrary::getPermanentLibrary(NU...
Definition DynamicLibrary.h:117
@ SO_LoadedFirst
SO_LoadedFirst - Search all loaded libraries, then as SO_Linker would.
Definition DynamicLibrary.h:119
static LLVM_ABI DynamicLibrary getPermanentLibrary(const char *filename, std::string *errMsg=nullptr)
This function permanently loads the dynamic library at the given path using the library load operatio...
static LLVM_ABI SearchOrdering SearchOrder
Definition DynamicLibrary.h:127
LLVM_ABI void * getAddressOfSymbol(const char *symbolName)
Searches through the library for the symbol symbolName.
bool isValid() const
Returns true if the object refers to a valid library.
Definition DynamicLibrary.h:50
static LLVM_ABI void * SearchForAddressOfSymbol(const char *symbolName)
This function will search through all previously loaded dynamic libraries for the symbol symbolName.
static LLVM_ABI void closeLibrary(DynamicLibrary &Lib)
This function closes the dynamic library at the given path, using the library close operation of the ...
This is an optimization pass for GlobalISel generic memory operations.