19 return [&ES, GetJD = std::move(GetJD)](
22 const std::vector<std::pair<StringRef, bool>> &Symbols)
mutable {
26 "No JITDylib associated with key " +
formatv(
"{0:x}",
Key),
31 std::vector<SymbolStringPtr> Names;
32 Names.reserve(Symbols.size());
34 for (
auto &[Name,
Required] : Symbols) {
35 Names.push_back(ES.
intern(Name));
50 [JD = std::move(JD), Names = std::move(Names),
53 return SendResult(Syms.takeError());
58 Result.reserve(Names.size());
59 for (
auto &Name : Names) {
60 auto I = Syms->find(Name);
62 Result.push_back(
I->second.getAddress());
64 Result.push_back(std::nullopt);
66 SendResult(std::move(
Result));
Tagged union holding either a T or a Error.
An ExecutionSession represents a running JIT program.
SymbolStringPtr intern(StringRef SymName)
Add a symbol name to the SymbolStringPool and return a pointer to it.
LLVM_ABI void lookup(LookupKind K, const JITDylibSearchOrder &SearchOrder, SymbolLookupSet Symbols, SymbolState RequiredState, SymbolsResolvedCallback NotifyComplete, RegisterDependenciesFunction RegisterDependencies)
Search the given JITDylibs for the given symbols.
Represents an address in the executor process.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
unique_function is a type-erasing functor similar to std::function.
unique_function< void( unique_function< void(Expected< SymbolLookupResult >)> SendResult, ExecutorAddr Key, JITDylibLookupFlags JDLookupFlags, const std::vector< std::pair< StringRef, bool > > &Symbols)> HandleLookupInJITDylibFn
Handler for executor-initiated lookups in JITDylibs.
unique_function< JITDylibSP(ExecutorAddr Key)> GetJITDylibForKeyFn
Maps an executor-supplied key to the JITDylib that it identifies, returning null if the key identifie...
IntrusiveRefCntPtr< JITDylib > JITDylibSP
std::vector< std::optional< ExecutorAddr > > SymbolLookupResult
The result of looking up a SymbolLookupSet in the executor: one entry per element of the set,...
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
LLVM_ABI RegisterDependenciesFunction NoDependenciesToRegister
This can be used as the value for a RegisterDependenciesFunction if there are no dependants to regist...
@ Ready
Emitted to memory, but waiting on transitive dependencies.
LLVM_ABI HandleLookupInJITDylibFn createLookupInJITDylibHandler(ExecutionSession &ES, GetJITDylibForKeyFn GetJD)
Create a handler for executor-initiated lookups in JITDylibs, callable via the ORC runtime's call-con...
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.