OrcTargetSupport.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //===-- OrcTargetSupport.h - Code to support specific targets --*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // Target specific code for Orc, e.g. callback assembly.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
  14. #define LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
  15. #include "IndirectionUtils.h"
  16. namespace llvm {
  17. namespace orc {
  18. class OrcX86_64 {
  19. public:
  20. static const char *ResolverBlockName;
  21. /// @brief Insert module-level inline callback asm into module M for the
  22. /// symbols managed by JITResolveCallbackHandler J.
  23. static void insertResolverBlock(Module &M,
  24. JITCompileCallbackManagerBase &JCBM);
  25. /// @brief Get a label name from the given index.
  26. typedef std::function<std::string(unsigned)> LabelNameFtor;
  27. /// @brief Insert the requested number of trampolines into the given module.
  28. /// @param M Module to insert the call block into.
  29. /// @param NumCalls Number of calls to create in the call block.
  30. /// @param StartIndex Optional argument specifying the index suffix to start
  31. /// with.
  32. /// @return A functor that provides the symbol name for each entry in the call
  33. /// block.
  34. ///
  35. static LabelNameFtor insertCompileCallbackTrampolines(
  36. Module &M,
  37. TargetAddress TrampolineAddr,
  38. unsigned NumCalls,
  39. unsigned StartIndex = 0);
  40. };
  41. } // End namespace orc.
  42. } // End namespace llvm.
  43. #endif // LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H