LLVM
8.0.1
|
A utility class to expose symbols found via dlsym to the JIT. More...
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
Public Types | |
using | SymbolPredicate = std::function< bool(SymbolStringPtr)> |
Public Member Functions | |
DynamicLibrarySearchGenerator (sys::DynamicLibrary Dylib, const DataLayout &DL, SymbolPredicate Allow=SymbolPredicate()) | |
Create a DynamicLibrarySearchGenerator that searches for symbols in the given sys::DynamicLibrary. More... | |
SymbolNameSet | operator() (JITDylib &JD, const SymbolNameSet &Names) |
Static Public Member Functions | |
static Expected< DynamicLibrarySearchGenerator > | Load (const char *FileName, const DataLayout &DL, SymbolPredicate Allow=SymbolPredicate()) |
Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenerator that will search it for symbol definitions in the library. More... | |
static Expected< DynamicLibrarySearchGenerator > | GetForCurrentProcess (const DataLayout &DL, SymbolPredicate Allow=SymbolPredicate()) |
Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process. More... | |
A utility class to expose symbols found via dlsym to the JIT.
If an instance of this class is attached to a JITDylib as a fallback definition generator, then any symbol found in the given DynamicLibrary that passes the 'Allow' predicate will be added to the JITDylib.
Definition at line 215 of file ExecutionUtils.h.
using llvm::orc::DynamicLibrarySearchGenerator::SymbolPredicate = std::function<bool(SymbolStringPtr)> |
Definition at line 217 of file ExecutionUtils.h.
llvm::orc::DynamicLibrarySearchGenerator::DynamicLibrarySearchGenerator | ( | sys::DynamicLibrary | Dylib, |
const DataLayout & | DL, | ||
SymbolPredicate | Allow = SymbolPredicate() |
||
) |
Create a DynamicLibrarySearchGenerator that searches for symbols in the given sys::DynamicLibrary.
If the Allow predicate is given then only symbols matching the predicate will be searched for in the DynamicLibrary. If the predicate is not given then all symbols will be searched for.
Definition at line 181 of file ExecutionUtils.cpp.
Referenced by Load().
|
inlinestatic |
Creates a DynamicLibrarySearchGenerator that searches for symbols in the current process.
Definition at line 237 of file ExecutionUtils.h.
References GlobalPrefix, and llvm::SPII::Load.
|
static |
Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenerator that will search it for symbol definitions in the library.
On failure returns the reason the library failed to load.
Definition at line 187 of file ExecutionUtils.cpp.
References DynamicLibrarySearchGenerator(), llvm::sys::DynamicLibrary::getPermanentLibrary(), llvm::inconvertibleErrorCode(), and operator()().
SymbolNameSet llvm::orc::DynamicLibrarySearchGenerator::operator() | ( | JITDylib & | JD, |
const SymbolNameSet & | Names | ||
) |
Definition at line 197 of file ExecutionUtils.cpp.
References llvm::orc::absoluteSymbols(), llvm::cantFail(), llvm::orc::JITDylib::define(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::JITSymbolFlags::Exported, llvm::sys::DynamicLibrary::getAddressOfSymbol(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and Name.
Referenced by Load().