LLVM API Documentation
#include <DynamicLibrary.h>

Implementation | |
| void * | handle |
| DynamicLibrary (const DynamicLibrary &) | |
| Do not implement. | |
| DynamicLibrary & | operator= (const DynamicLibrary &) |
Public Member Functions | |
Constructors | |
| DynamicLibrary () | |
| Open program as dynamic library. | |
| ~DynamicLibrary () | |
| Closes the DynamicLibrary. | |
Static Public Member Functions | |
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 32 of file DynamicLibrary.h.
| DynamicLibrary::DynamicLibrary | ( | ) |
Open program as dynamic library.
Construct a DynamicLibrary that represents the currently executing program. The program must have been linked with -export-dynamic or -dlopen self for this to work.
| std::string | indicating why the program couldn't be opened. |
Definition at line 54 of file DynamicLibrary.cpp.
| DynamicLibrary::~DynamicLibrary | ( | ) |
Closes the DynamicLibrary.
After destruction, the symbols of the library will no longer be available to the program.
Definition at line 56 of file DynamicLibrary.cpp.
References H, and OpenedHandles.
| llvm::sys::DynamicLibrary::DynamicLibrary | ( | const DynamicLibrary & | ) | [protected] |
Do not implement.
| 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.
Definition at line 63 of file DynamicLibrary.cpp.
References H, and OpenedHandles.
Referenced by llvm::ExecutionEngine::create(), llvm::ExecutionEngine::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. |
Definition at line 75 of file DynamicLibrary.cpp.
References E, EXPLICIT_SYMBOL, g_symbols, I, and OpenedHandles.
Referenced by llvm::ExecutionEngine::emitGlobals(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToNamedFunction(), and SearchForAddressOfSymbol().
| static void* llvm::sys::DynamicLibrary::SearchForAddressOfSymbol | ( | const std::string & | symbolName | ) | [inline, static] |
Convenience function for C++ophiles.
Definition at line 70 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.
Definition at line 23 of file DynamicLibrary.cpp.
References g_symbols.
Referenced by AddSymbol().
| static void llvm::sys::DynamicLibrary::AddSymbol | ( | const std::string & | symbolName, | |
| void * | symbolValue | |||
| ) | [inline, static] |
Convenience function for C++ophiles.
Definition at line 81 of file DynamicLibrary.h.
References AddSymbol().
| DynamicLibrary& llvm::sys::DynamicLibrary::operator= | ( | const DynamicLibrary & | ) | [protected] |
Do not implement
void* llvm::sys::DynamicLibrary::handle [protected] |
Definition at line 89 of file DynamicLibrary.h.
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.