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