13#ifndef LLVM_SUPPORT_DYNAMICLIBRARY_H
14#define LLVM_SUPPORT_DYNAMICLIBRARY_H
71 std::string *errMsg =
nullptr);
79 std::string *errMsg =
nullptr);
87 std::string *ErrMsg =
nullptr) {
102 std::string *Err =
nullptr);
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...
static 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 DynamicLibrary addPermanentLibrary(void *handle, std::string *errMsg=nullptr)
Registers an externally loaded library.
static 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.
static bool LoadLibraryPermanently(const char *Filename, std::string *ErrMsg=nullptr)
This function permanently loads the dynamic library at the given path.
DynamicLibrary(void *data=&Invalid)
static void * SearchForAddressOfSymbol(const std::string &symbolName)
Convenience function for C++ophiles.
@ SO_LoadedLast
SO_LoadedLast - Search as SO_Linker would, then loaded libraries.
@ SO_LoadOrder
SO_LoadOrder - Or this in to search libraries in the ordered loaded.
@ SO_Linker
SO_Linker - Search as a call to dlsym(dlopen(NULL)) would when DynamicLibrary::getPermanentLibrary(NU...
@ SO_LoadedFirst
SO_LoadedFirst - Search all loaded libraries, then as SO_Linker would.
static 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 SearchOrdering SearchOrder
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.
static void * SearchForAddressOfSymbol(const char *symbolName)
This function will search through all previously loaded dynamic libraries for the symbol symbolName.
static 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.