LLVM 20.0.0git
|
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
Public Types | |
using | SymbolPredicate = unique_function< bool(const SymbolStringPtr &)> |
using | AddAbsoluteSymbolsFn = unique_function< Error(JITDylib &, SymbolMap)> |
Public Member Functions | |
EPCDynamicLibrarySearchGenerator (ExecutionSession &ES, tpctypes::DylibHandle H, SymbolPredicate Allow=SymbolPredicate(), AddAbsoluteSymbolsFn AddAbsoluteSymbols=nullptr) | |
Create a DynamicLibrarySearchGenerator that searches for symbols in the library with the given handle. | |
Error | tryToGenerate (LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &Symbols) override |
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib. | |
Public Member Functions inherited from llvm::orc::DefinitionGenerator | |
virtual | ~DefinitionGenerator () |
virtual Error | tryToGenerate (LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &LookupSet)=0 |
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib. | |
Static Public Member Functions | |
static Expected< std::unique_ptr< EPCDynamicLibrarySearchGenerator > > | Load (ExecutionSession &ES, const char *LibraryPath, SymbolPredicate Allow=SymbolPredicate(), AddAbsoluteSymbolsFn AddAbsoluteSymbols=nullptr) |
Permanently loads the library at the given path and, on success, returns a DynamicLibrarySearchGenerator that will search it for symbol definitions in the library. | |
static Expected< std::unique_ptr< EPCDynamicLibrarySearchGenerator > > | GetForTargetProcess (ExecutionSession &ES, SymbolPredicate Allow=SymbolPredicate(), AddAbsoluteSymbolsFn AddAbsoluteSymbols=nullptr) |
Creates a EPCDynamicLibrarySearchGenerator that searches for symbols in the target process. | |
Definition at line 25 of file EPCDynamicLibrarySearchGenerator.h.
using llvm::orc::EPCDynamicLibrarySearchGenerator::AddAbsoluteSymbolsFn = unique_function<Error(JITDylib &, SymbolMap)> |
Definition at line 28 of file EPCDynamicLibrarySearchGenerator.h.
using llvm::orc::EPCDynamicLibrarySearchGenerator::SymbolPredicate = unique_function<bool(const SymbolStringPtr &)> |
Definition at line 27 of file EPCDynamicLibrarySearchGenerator.h.
|
inline |
Create a DynamicLibrarySearchGenerator that searches for symbols in the library with the given handle.
If the Allow predicate is given then only symbols matching the predicate will be searched for. If the predicate is not given then all symbols will be searched for.
If AddAbsoluteSymbols
is provided, it is used to add the symbols to the JITDylib
; otherwise it uses JD.define(absoluteSymbols(...)).
Definition at line 39 of file EPCDynamicLibrarySearchGenerator.h.
References H.
|
inlinestatic |
Creates a EPCDynamicLibrarySearchGenerator that searches for symbols in the target process.
Definition at line 57 of file EPCDynamicLibrarySearchGenerator.h.
References Load().
Referenced by llvm::orc::LLJITBuilderState::prepareForConstruction().
|
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 21 of file EPCDynamicLibrarySearchGenerator.cpp.
References llvm::orc::ExecutorProcessControl::getDylibMgr(), llvm::orc::ExecutionSession::getExecutorProcessControl(), and llvm::orc::DylibManager::loadDylib().
Referenced by GetForTargetProcess(), and llvm::orc::LLJIT::loadPlatformDynamicLibrary().
|
overridevirtual |
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.
K specifies the kind of this lookup. JD specifies the target JITDylib being searched, and JDLookupFlags specifies whether the search should match against hidden symbols. Finally, Symbols describes the set of unresolved symbols and their associated lookup flags.
Implements llvm::orc::DefinitionGenerator.
Definition at line 33 of file EPCDynamicLibrarySearchGenerator.cpp.
References llvm::orc::absoluteSymbols(), llvm::orc::SymbolLookupSet::add(), assert(), llvm::dbgs(), llvm::orc::JITDylib::define(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::orc::ExecutorProcessControl::getDylibMgr(), LLVM_DEBUG, llvm::orc::DylibManager::lookupSymbolsAsync(), llvm::orc::Result, llvm::Error::success(), and llvm::orc::WeaklyReferencedSymbol.