OrcRTBridge.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===---- OrcRTBridge.h -- Utils for interacting with orc-rt ----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Declares types and symbol names provided by the ORC runtime.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H
  18. #define LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H
  19. #include "llvm/ADT/StringMap.h"
  20. #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
  21. #include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h"
  22. #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h"
  23. namespace llvm {
  24. namespace orc {
  25. namespace rt {
  26. extern const char *SimpleExecutorDylibManagerInstanceName;
  27. extern const char *SimpleExecutorDylibManagerOpenWrapperName;
  28. extern const char *SimpleExecutorDylibManagerLookupWrapperName;
  29. extern const char *SimpleExecutorMemoryManagerInstanceName;
  30. extern const char *SimpleExecutorMemoryManagerReserveWrapperName;
  31. extern const char *SimpleExecutorMemoryManagerFinalizeWrapperName;
  32. extern const char *SimpleExecutorMemoryManagerDeallocateWrapperName;
  33. extern const char *ExecutorSharedMemoryMapperServiceInstanceName;
  34. extern const char *ExecutorSharedMemoryMapperServiceReserveWrapperName;
  35. extern const char *ExecutorSharedMemoryMapperServiceInitializeWrapperName;
  36. extern const char *ExecutorSharedMemoryMapperServiceDeinitializeWrapperName;
  37. extern const char *ExecutorSharedMemoryMapperServiceReleaseWrapperName;
  38. extern const char *MemoryWriteUInt8sWrapperName;
  39. extern const char *MemoryWriteUInt16sWrapperName;
  40. extern const char *MemoryWriteUInt32sWrapperName;
  41. extern const char *MemoryWriteUInt64sWrapperName;
  42. extern const char *MemoryWriteBuffersWrapperName;
  43. extern const char *RegisterEHFrameSectionWrapperName;
  44. extern const char *DeregisterEHFrameSectionWrapperName;
  45. extern const char *RunAsMainWrapperName;
  46. extern const char *RunAsVoidFunctionWrapperName;
  47. extern const char *RunAsIntFunctionWrapperName;
  48. using SPSSimpleExecutorDylibManagerOpenSignature =
  49. shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr,
  50. shared::SPSString, uint64_t);
  51. using SPSSimpleExecutorDylibManagerLookupSignature =
  52. shared::SPSExpected<shared::SPSSequence<shared::SPSExecutorAddr>>(
  53. shared::SPSExecutorAddr, shared::SPSExecutorAddr,
  54. shared::SPSRemoteSymbolLookupSet);
  55. using SPSSimpleExecutorMemoryManagerReserveSignature =
  56. shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr,
  57. uint64_t);
  58. using SPSSimpleExecutorMemoryManagerFinalizeSignature =
  59. shared::SPSError(shared::SPSExecutorAddr, shared::SPSFinalizeRequest);
  60. using SPSSimpleExecutorMemoryManagerDeallocateSignature = shared::SPSError(
  61. shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>);
  62. // ExecutorSharedMemoryMapperService
  63. using SPSExecutorSharedMemoryMapperServiceReserveSignature =
  64. shared::SPSExpected<
  65. shared::SPSTuple<shared::SPSExecutorAddr, shared::SPSString>>(
  66. shared::SPSExecutorAddr, uint64_t);
  67. using SPSExecutorSharedMemoryMapperServiceInitializeSignature =
  68. shared::SPSExpected<shared::SPSExecutorAddr>(
  69. shared::SPSExecutorAddr, shared::SPSExecutorAddr,
  70. shared::SPSSharedMemoryFinalizeRequest);
  71. using SPSExecutorSharedMemoryMapperServiceDeinitializeSignature =
  72. shared::SPSError(shared::SPSExecutorAddr,
  73. shared::SPSSequence<shared::SPSExecutorAddr>);
  74. using SPSExecutorSharedMemoryMapperServiceReleaseSignature = shared::SPSError(
  75. shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>);
  76. using SPSRunAsMainSignature = int64_t(shared::SPSExecutorAddr,
  77. shared::SPSSequence<shared::SPSString>);
  78. using SPSRunAsVoidFunctionSignature = int32_t(shared::SPSExecutorAddr);
  79. using SPSRunAsIntFunctionSignature = int32_t(shared::SPSExecutorAddr, int32_t);
  80. } // end namespace rt
  81. } // end namespace orc
  82. } // end namespace llvm
  83. #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H
  84. #ifdef __GNUC__
  85. #pragma GCC diagnostic pop
  86. #endif