]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / include / llvm / ExecutionEngine / Orc / Shared / OrcRTBridge.h
1 //===---- OrcRTBridge.h -- Utils for interacting with orc-rt ----*- 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 // Declares types and symbol names provided by the ORC runtime.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H
14 #define LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H
15
16 #include "llvm/ADT/StringMap.h"
17 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
18 #include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h"
19 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h"
20
21 namespace llvm {
22 namespace orc {
23 namespace rt {
24
25 extern const char *SimpleExecutorDylibManagerInstanceName;
26 extern const char *SimpleExecutorDylibManagerOpenWrapperName;
27 extern const char *SimpleExecutorDylibManagerLookupWrapperName;
28
29 extern const char *SimpleExecutorMemoryManagerInstanceName;
30 extern const char *SimpleExecutorMemoryManagerReserveWrapperName;
31 extern const char *SimpleExecutorMemoryManagerFinalizeWrapperName;
32 extern const char *SimpleExecutorMemoryManagerDeallocateWrapperName;
33
34 extern const char *ExecutorSharedMemoryMapperServiceInstanceName;
35 extern const char *ExecutorSharedMemoryMapperServiceReserveWrapperName;
36 extern const char *ExecutorSharedMemoryMapperServiceInitializeWrapperName;
37 extern const char *ExecutorSharedMemoryMapperServiceDeinitializeWrapperName;
38 extern const char *ExecutorSharedMemoryMapperServiceReleaseWrapperName;
39
40 extern const char *MemoryWriteUInt8sWrapperName;
41 extern const char *MemoryWriteUInt16sWrapperName;
42 extern const char *MemoryWriteUInt32sWrapperName;
43 extern const char *MemoryWriteUInt64sWrapperName;
44 extern const char *MemoryWriteBuffersWrapperName;
45
46 extern const char *RegisterEHFrameSectionWrapperName;
47 extern const char *DeregisterEHFrameSectionWrapperName;
48
49 extern const char *RunAsMainWrapperName;
50
51 using SPSSimpleExecutorDylibManagerOpenSignature =
52     shared::SPSExpected<uint64_t>(shared::SPSExecutorAddr, shared::SPSString,
53                                   uint64_t);
54
55 using SPSSimpleExecutorDylibManagerLookupSignature =
56     shared::SPSExpected<shared::SPSSequence<shared::SPSExecutorAddr>>(
57         shared::SPSExecutorAddr, uint64_t, shared::SPSRemoteSymbolLookupSet);
58
59 using SPSSimpleExecutorMemoryManagerReserveSignature =
60     shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr,
61                                                  uint64_t);
62 using SPSSimpleExecutorMemoryManagerFinalizeSignature =
63     shared::SPSError(shared::SPSExecutorAddr, shared::SPSFinalizeRequest);
64 using SPSSimpleExecutorMemoryManagerDeallocateSignature = shared::SPSError(
65     shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>);
66
67 // ExecutorSharedMemoryMapperService
68 using SPSExecutorSharedMemoryMapperServiceReserveSignature =
69     shared::SPSExpected<
70         shared::SPSTuple<shared::SPSExecutorAddr, shared::SPSString>>(
71         shared::SPSExecutorAddr, uint64_t);
72 using SPSExecutorSharedMemoryMapperServiceInitializeSignature =
73     shared::SPSExpected<shared::SPSExecutorAddr>(
74         shared::SPSExecutorAddr, shared::SPSExecutorAddr,
75         shared::SPSSharedMemoryFinalizeRequest);
76 using SPSExecutorSharedMemoryMapperServiceDeinitializeSignature =
77     shared::SPSError(shared::SPSExecutorAddr,
78                      shared::SPSSequence<shared::SPSExecutorAddr>);
79 using SPSExecutorSharedMemoryMapperServiceReleaseSignature = shared::SPSError(
80     shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>);
81
82 using SPSRunAsMainSignature = int64_t(shared::SPSExecutorAddr,
83                                       shared::SPSSequence<shared::SPSString>);
84
85 } // end namespace rt
86 } // end namespace orc
87 } // end namespace llvm
88
89 #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H