LLVM API Documentation
#include <DynamicLibrary.h>
Static Public Member Functions | |
| static bool | LoadLibraryPermanently (const char *filename, std::string *ErrMsg=0) |
| Open a dynamic library permanently. | |
| static void * | SearchForAddressOfSymbol (const char *symbolName) |
| Search through libraries for address of a symbol. | |
| static void * | SearchForAddressOfSymbol (const std::string &symbolName) |
| Convenience function for C++ophiles. | |
| static void | AddSymbol (const char *symbolName, void *symbolValue) |
| Add searchable symbol/value pair. | |
| static void | AddSymbol (const std::string &symbolName, void *symbolValue) |
| Convenience function for C++ophiles. | |
Definition at line 31 of file DynamicLibrary.h.
| bool DynamicLibrary::LoadLibraryPermanently | ( | const char * | filename, | |
| std::string * | ErrMsg = 0 | |||
| ) | [static] |
Open a dynamic library permanently.
This function allows a library to be loaded without instantiating a DynamicLibrary object. Consequently, it is marked as being permanent and will only be unloaded when the program terminates. This returns false on success or returns true and fills in *ErrMsg on failure. NOTE: This function is not thread safe.
Definition at line 53 of file DynamicLibrary.cpp.
References H, and OpenedHandles.
Referenced by llvm::EngineBuilder::create(), llvm::JIT::createJIT(), and llvm::PluginLoader::operator=().
| void * DynamicLibrary::SearchForAddressOfSymbol | ( | const char * | symbolName | ) | [static] |
Search through libraries for address of a symbol.
This function will search through all previously loaded dynamic libraries for the symbol symbolName. If it is found, the addressof that symbol is returned. If not, null is returned. Note that this will search permanently loaded libraries (LoadLibraryPermanently) as well as ephemerally loaded libraries (constructors).
| std::string | on error. NOTE: This function is not thread safe. |
Definition at line 66 of file DynamicLibrary.cpp.
References E, EXPLICIT_SYMBOL, ExplicitSymbols, and OpenedHandles.
Referenced by llvm::Interpreter::callExternalFunction(), llvm::ExecutionEngine::emitGlobals(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToNamedFunction(), lookupFunction(), and SearchForAddressOfSymbol().
| static void* llvm::sys::DynamicLibrary::SearchForAddressOfSymbol | ( | const std::string & | symbolName | ) | [inline, static] |
Convenience function for C++ophiles.
NOTE: This function is not thread safe.
Definition at line 61 of file DynamicLibrary.h.
References SearchForAddressOfSymbol().
| void llvm::sys::DynamicLibrary::AddSymbol | ( | const char * | symbolName, | |
| void * | symbolValue | |||
| ) | [static] |
Add searchable symbol/value pair.
This functions permanently adds the symbol symbolName with the value symbolValue. These symbols are searched before any libraries. NOTE: This function is not thread safe.
Definition at line 28 of file DynamicLibrary.cpp.
References ExplicitSymbols.
Referenced by AddSymbol().
| static void llvm::sys::DynamicLibrary::AddSymbol | ( | const std::string & | symbolName, | |
| void * | symbolValue | |||
| ) | [inline, static] |
Convenience function for C++ophiles.
NOTE: This function is not thread safe.
Definition at line 78 of file DynamicLibrary.h.
References AddSymbol().