LLVM 24.0.0git
EPCGenericDylibManagerSPS.cpp
Go to the documentation of this file.
1//===- EPCGenericDylibManagerSPS.cpp - SPS dylib management ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
15
16namespace llvm::orc::shared {
17
18// Serialize a local SymbolLookupSet directly as an SPSRemoteSymbolLookupSet,
19// avoiding a std::string copy of each (potentially large) symbol name.
20template <>
22 SymbolLookupSet::value_type> {
23public:
24 static size_t size(const SymbolLookupSet::value_type &V) {
26 *V.first, V.second == SymbolLookupFlags::RequiredSymbol);
27 }
28
29 static bool serialize(SPSOutputBuffer &OB,
32 OB, *V.first, V.second == SymbolLookupFlags::RequiredSymbol);
33 }
34};
35
36template <>
39public:
40 static constexpr bool available = true;
41};
42
43} // namespace llvm::orc::shared
44
45namespace llvm::orc::sps {
46
49 auto &ES = JD.getExecutionSession();
51 // Instance is the executor-side manager object -- a data symbol passed as the
52 // first argument to each call, not a wrapper to proxy. The proxies resolve to
53 // the specs' default (NativeDylibManager) names.
54 if (auto Err = lookupAndApply(
55 JD,
59 return std::move(Err);
60 return std::make_unique<EPCGenericDylibManager>(ES, std::move(B));
61}
62
67
68} // namespace llvm::orc::sps
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Tagged union holding either a T or a Error.
Definition Error.h:485
An ExecutionSession represents a running JIT program.
Definition Core.h:1111
JITDylib & getBootstrapJITDylib()
Returns a reference to the bootstrap JITDylib.
Definition Core.h:1177
Represents a JIT'd dynamic library.
Definition Core.h:675
ExecutionSession & getExecutionSession() const
Get a reference to the ExecutionSession for this JITDylib.
Definition Core.h:694
A set of symbols to look up, each associated with a SymbolLookupFlags value.
std::pair< SymbolStringPtr, SymbolLookupFlags > value_type
A utility class for serializing to a blob from a variadic list.
Output char buffer with overflow check.
Specialize to describe how to serialize/deserialize to/from the given concrete type.
Specialize this to implement 'trivial' sequence serialization for a concrete sequence type.
constexpr char NativeDylibManagerInstanceName[]
The executor-side dylib-manager instance.
SPSTuple< SPSString, bool > SPSRemoteSymbolLookupSetElement
LLVM_ABI Expected< std::unique_ptr< EPCGenericDylibManager > > createEPCGenericDylibManager(JITDylib &JD)
Create an EPCGenericDylibManager for the ORC runtime's NativeDylibManager interface,...
LookupPrepareFn recordProxy(Proxy< FnT > *P, typename Proxy< FnT >::DispatchFn Dispatch, StringRef Name, SymbolLookupFlags LF=SymbolLookupFlags::RequiredSymbol)
Builds P over the symbol with the given name, dispatching through Dispatch.
Definition RecordProxy.h:30
LLVM_ABI void lookupAndApply(unique_function< void(Error)> OnApplied, ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder, ArrayRef< LookupPrepareFn > PrepareFns)
Resolve the symbols contributed by every prepare function with a single lookup, then let each of thei...
LookupPrepareFn recordAddr(StringRef Name, ExecutorAddr *A, SymbolLookupFlags LF=SymbolLookupFlags::RequiredSymbol)
Records the address of the symbol with the given name.
The resolved controller-side handle to an executor-side dylib manager: the address of the manager ins...