LLVM 24.0.0git
EPCGenericJITLinkMemoryManagerSPS.cpp
Go to the documentation of this file.
1//===- EPCGenericJITLinkMemoryManagerSPS.cpp - SPS mem manager ------------===//
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
13
14namespace llvm::orc::sps {
15
16Expected<std::unique_ptr<EPCGenericJITLinkMemoryManager>>
18 auto &ES = JD.getExecutionSession();
20 // Instance is the executor-side allocator object -- a data symbol passed as
21 // the first argument to each call, not a wrapper to proxy.
22 if (auto Err = lookupAndRecordAddrs(
25 &B.Instance}}))
26 return std::move(Err);
27 // The proxies resolve to the specs' default (SimpleNativeMemoryMap) names.
28 if (auto Err =
33 return std::move(Err);
34 return std::make_unique<EPCGenericJITLinkMemoryManager>(ES, std::move(B));
35}
36
41
42} // 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
constexpr char SimpleNativeMemoryMapInstanceName[]
The executor-side memory-manager instance.
LLVM_ABI Expected< std::unique_ptr< EPCGenericJITLinkMemoryManager > > createEPCGenericJITLinkMemoryManager(JITDylib &JD)
Create an EPCGenericJITLinkMemoryManager for the ORC runtime's SimpleNativeMemoryMap interface,...
JITDylibSearchOrder makeJITDylibSearchOrder(ArrayRef< JITDylib * > JDs, JITDylibLookupFlags Flags=JITDylibLookupFlags::MatchExportedSymbolsOnly)
Convenience function for creating a search order from an ArrayRef of JITDylib*, all with the same fla...
Definition Core.h:153
ProxyInit< FnT > proxyInit(Proxy< FnT > *P, typename Proxy< FnT >::DispatchFn Dispatch, StringRef Name, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)
Definition Proxy.h:168
LLVM_ABI void lookupAndRecordAddrs(unique_function< void(Error)> OnRecorded, ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder, std::vector< std::pair< SymbolStringPtr, ExecutorAddr * > > Pairs, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)
Record addresses of the given symbols in the given ExecutorAddrs.
Error buildProxies(JITDylib &JD)
buildProxies base case.
Definition Proxy.h:189
The resolved controller-side handle to an executor-side memory manager: the address of the allocator ...