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 *MemoryWriteUInt8sWrapperName; 35 extern const char *MemoryWriteUInt16sWrapperName; 36 extern const char *MemoryWriteUInt32sWrapperName; 37 extern const char *MemoryWriteUInt64sWrapperName; 38 extern const char *MemoryWriteBuffersWrapperName; 39 40 extern const char *RegisterEHFrameSectionWrapperName; 41 extern const char *DeregisterEHFrameSectionWrapperName; 42 43 extern const char *RunAsMainWrapperName; 44 45 using SPSSimpleExecutorDylibManagerOpenSignature = 46 shared::SPSExpected<uint64_t>(shared::SPSExecutorAddr, shared::SPSString, 47 uint64_t); 48 49 using SPSSimpleExecutorDylibManagerLookupSignature = 50 shared::SPSExpected<shared::SPSSequence<shared::SPSExecutorAddr>>( 51 shared::SPSExecutorAddr, uint64_t, shared::SPSRemoteSymbolLookupSet); 52 53 using SPSSimpleExecutorMemoryManagerReserveSignature = 54 shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr, 55 uint64_t); 56 using SPSSimpleExecutorMemoryManagerFinalizeSignature = 57 shared::SPSError(shared::SPSExecutorAddr, shared::SPSFinalizeRequest); 58 using SPSSimpleExecutorMemoryManagerDeallocateSignature = shared::SPSError( 59 shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>); 60 61 using SPSRunAsMainSignature = int64_t(shared::SPSExecutorAddr, 62 shared::SPSSequence<shared::SPSString>); 63 64 } // end namespace rt 65 } // end namespace orc 66 } // end namespace llvm 67 68 #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H 69