MachO_arm64.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===---- MachO_arm64.h - JIT link functions for MachO/arm64 ----*- 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. // jit-link functions for MachO/arm64.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_EXECUTIONENGINE_JITLINK_MACHO_ARM64_H
  18. #define LLVM_EXECUTIONENGINE_JITLINK_MACHO_ARM64_H
  19. #include "llvm/ExecutionEngine/JITLink/JITLink.h"
  20. namespace llvm {
  21. namespace jitlink {
  22. /// Create a LinkGraph from a MachO/arm64 relocatable object.
  23. ///
  24. /// Note: The graph does not take ownership of the underlying buffer, nor copy
  25. /// its contents. The caller is responsible for ensuring that the object buffer
  26. /// outlives the graph.
  27. Expected<std::unique_ptr<LinkGraph>>
  28. createLinkGraphFromMachOObject_arm64(MemoryBufferRef ObjectBuffer);
  29. /// jit-link the given object buffer, which must be a MachO arm64 object file.
  30. ///
  31. /// If PrePrunePasses is empty then a default mark-live pass will be inserted
  32. /// that will mark all exported atoms live. If PrePrunePasses is not empty, the
  33. /// caller is responsible for including a pass to mark atoms as live.
  34. ///
  35. /// If PostPrunePasses is empty then a default GOT-and-stubs insertion pass will
  36. /// be inserted. If PostPrunePasses is not empty then the caller is responsible
  37. /// for including a pass to insert GOT and stub edges.
  38. void link_MachO_arm64(std::unique_ptr<LinkGraph> G,
  39. std::unique_ptr<JITLinkContext> Ctx);
  40. /// Returns a pass suitable for splitting __eh_frame sections in MachO/x86-64
  41. /// objects.
  42. LinkGraphPassFunction createEHFrameSplitterPass_MachO_arm64();
  43. /// Returns a pass suitable for fixing missing edges in an __eh_frame section
  44. /// in a MachO/x86-64 object.
  45. LinkGraphPassFunction createEHFrameEdgeFixerPass_MachO_arm64();
  46. } // end namespace jitlink
  47. } // end namespace llvm
  48. #endif // LLVM_EXECUTIONENGINE_JITLINK_MACHO_ARM64_H
  49. #ifdef __GNUC__
  50. #pragma GCC diagnostic pop
  51. #endif