15#ifndef LLVM_EXECUTIONENGINE_ORC_EXECUTORRESOLUTIONGENERATOR_H
16#define LLVM_EXECUTIONENGINE_ORC_EXECUTORRESOLUTIONGENERATOR_H
34 : EPC(ES.getExecutorProcessControl()), H(H), Allow(
std::
move(Allow)),
35 AbsoluteSymbols(
std::
move(AbsoluteSymbols)) {}
40 : EPC(ES.getExecutorProcessControl()), Allow(
std::
move(Allow)),
41 AbsoluteSymbols(
std::
move(AbsoluteSymbols)) {}
58 return Load(ES,
nullptr, std::move(Allow), std::move(AbsoluteSymbols));
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Definition generators can be attached to JITDylibs to generate new definitions for otherwise unresolv...
friend class ExecutionSession
An ExecutionSession represents a running JIT program.
ExecutorProcessControl supports interaction with a JIT target process.
static Expected< std::unique_ptr< ExecutorResolutionGenerator > > Load(ExecutionSession &ES, const char *LibraryPath, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
Permanently loads the library at the given path and, on success, returns an ExecutorResolutionGenerat...
unique_function< std::unique_ptr< MaterializationUnit >(SymbolMap)> AbsoluteSymbolsFn
ExecutorResolutionGenerator(ExecutionSession &ES, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
ExecutorResolutionGenerator(ExecutionSession &ES, tpctypes::ResolverHandle H, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
Error tryToGenerate(LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &LookupSet) override
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.
static Expected< std::unique_ptr< ExecutorResolutionGenerator > > GetForTargetProcess(ExecutionSession &ES, SymbolPredicate Allow=SymbolPredicate(), AbsoluteSymbolsFn AbsoluteSymbols=absoluteSymbols)
Creates a ExecutorResolutionGenerator that searches for symbols in the target process.
unique_function< bool(const SymbolStringPtr &)> SymbolPredicate
Represents a JIT'd dynamic library.
Wraps state for a lookup-in-progress.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
Pointer to a pooled string representing a symbol name.
unique_function is a type-erasing functor similar to std::function.
ExecutorAddr ResolverHandle
A handle used to reference the resolver associated with a loaded dylib in the target process.
std::unique_ptr< AbsoluteSymbolsMaterializationUnit > absoluteSymbols(SymbolMap Symbols)
Create an AbsoluteSymbolsMaterializationUnit with the given symbols.
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
LookupKind
Describes the kind of lookup being performed.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.