MachO.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===------- MachO.h - Generic JIT link function for MachO ------*- 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. // Generic jit-link functions for MachO.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_EXECUTIONENGINE_JITLINK_MACHO_H
  18. #define LLVM_EXECUTIONENGINE_JITLINK_MACHO_H
  19. #include "llvm/ExecutionEngine/JITLink/JITLink.h"
  20. namespace llvm {
  21. namespace jitlink {
  22. /// Create a LinkGraph from a MachO 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(MemoryBufferRef ObjectBuffer);
  29. /// jit-link the given ObjBuffer, which must be a MachO object file.
  30. ///
  31. /// Uses conservative defaults for GOT and stub handling based on the target
  32. /// platform.
  33. void link_MachO(std::unique_ptr<LinkGraph> G,
  34. std::unique_ptr<JITLinkContext> Ctx);
  35. } // end namespace jitlink
  36. } // end namespace llvm
  37. #endif // LLVM_EXECUTIONENGINE_JITLINK_MACHO_H
  38. #ifdef __GNUC__
  39. #pragma GCC diagnostic pop
  40. #endif