LLVM  3.7.0
OrcTargetSupport.h
Go to the documentation of this file.
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 
14 #ifndef LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
15 #define LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
16 
17 #include "IndirectionUtils.h"
18 
19 namespace llvm {
20 namespace orc {
21 
22 class OrcX86_64 {
23 public:
24  static const char *ResolverBlockName;
25 
26  /// @brief Insert module-level inline callback asm into module M for the
27  /// symbols managed by JITResolveCallbackHandler J.
28  static void insertResolverBlock(Module &M,
30 
31  /// @brief Get a label name from the given index.
32  typedef std::function<std::string(unsigned)> LabelNameFtor;
33 
34  /// @brief Insert the requested number of trampolines into the given module.
35  /// @param M Module to insert the call block into.
36  /// @param NumCalls Number of calls to create in the call block.
37  /// @param StartIndex Optional argument specifying the index suffix to start
38  /// with.
39  /// @return A functor that provides the symbol name for each entry in the call
40  /// block.
41  ///
43  Module &M,
44  TargetAddress TrampolineAddr,
45  unsigned NumCalls,
46  unsigned StartIndex = 0);
47 
48 };
49 
50 } // End namespace orc.
51 } // End namespace llvm.
52 
53 #endif // LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:114
static void insertResolverBlock(Module &M, JITCompileCallbackManagerBase &JCBM)
Insert module-level inline callback asm into module M for the symbols managed by JITResolveCallbackHa...
Base class for JITLayer independent aspects of JITCompileCallbackManager.
static const char * ResolverBlockName
uint64_t TargetAddress
Represents an address in the target process's address space.
Definition: JITSymbol.h:26
std::function< std::string(unsigned)> LabelNameFtor
Get a label name from the given index.
static LabelNameFtor insertCompileCallbackTrampolines(Module &M, TargetAddress TrampolineAddr, unsigned NumCalls, unsigned StartIndex=0)
Insert the requested number of trampolines into the given module.