LLVM 24.0.0git
EPCGenericJITLinkMemoryManager.h
Go to the documentation of this file.
1//===- EPCGenericJITLinkMemoryManager.h - EPC-based mem manager -*- C++ -*-===//
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//
9// Implements JITLinkMemoryManager by calling executor-side wrapper functions
10// through Proxy objects.
11//
12// This simplifies the implementaton of new ExecutorProcessControl instances,
13// as this implementation will always work (at the cost of some performance
14// overhead for the calls).
15//
16// This header is protocol-agnostic. To build an instance that targets the ORC
17// runtime's SPS controller interface, see EPCGenericJITLinkMemoryManagerSPS.h.
18//
19//===----------------------------------------------------------------------===//
20
21#ifndef LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
22#define LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
23
29
30#include <cstdint>
31
32namespace llvm {
33namespace orc {
34
37public:
38 /// Create an EPCGenericJITLinkMemoryManager instance from a given set of
39 /// memory-manager bindings.
43
44 void allocate(const jitlink::JITLinkDylib *JD, jitlink::LinkGraph &G,
45 OnAllocatedFunction OnAllocated) override;
46
47 // Use overloads from base class.
48 using JITLinkMemoryManager::allocate;
49
50 void deallocate(std::vector<FinalizedAlloc> Allocs,
51 OnDeallocatedFunction OnDeallocated) override;
52
53 // Use overloads from base class.
54 using JITLinkMemoryManager::deallocate;
55
56private:
57 class InFlightAlloc;
58
59 void completeAllocation(ExecutorAddr AllocAddr, jitlink::BasicLayout BL,
60 OnAllocatedFunction OnAllocated);
61
64};
65
66} // end namespace orc
67} // end namespace llvm
68
69#endif // LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_ABI
Definition Compiler.h:215
#define G(x, y, z)
Definition MD5.cpp:55
EPCGenericJITLinkMemoryManager(ExecutionSession &ES, SimpleMemoryMapBindings B)
Create an EPCGenericJITLinkMemoryManager instance from a given set of memory-manager bindings.
An ExecutionSession represents a running JIT program.
Definition Core.h:1111
Represents an address in the executor process.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1917
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:878
The resolved controller-side handle to an executor-side memory manager: the address of the manager in...