Files
llvm-6502/include/llvm/ExecutionEngine/Orc/OrcTargetSupport.h
Lang Hames 0d40b2b30f [Orc] Update the Orc indirection utils and refactor the CompileOnDemand layer.
This patch replaces most of the Orc indirection utils API with a new class:
JITCompileCallbackManager, which creates and manages JIT callbacks.
Exposing this functionality directly allows the user to create callbacks that
are associated with user supplied compilation actions. For example, you can
create a callback to lazyily IR-gen something from an AST. (A kaleidoscope
example demonstrating this will be committed shortly).

This patch also refactors the CompileOnDemand layer to use the
JITCompileCallbackManager API.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229461 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 01:18:38 +00:00

55 lines
1.9 KiB
C++

//===-- OrcTargetSupport.h - Code to support specific targets --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Target specific code for Orc, e.g. callback assembly.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
#define LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H
#include "IndirectionUtils.h"
namespace llvm {
class OrcX86_64 {
public:
static const char *ResolverBlockName;
/// @brief Insert module-level inline callback asm into module M for the
/// symbols managed by JITResolveCallbackHandler J.
static void insertResolverBlock(
Module &M,
JITCompileCallbackManagerBase<OrcX86_64> &JCBM);
/// @brief Get a label name from the given index.
typedef std::function<std::string(unsigned)> LabelNameFtor;
static const unsigned CallSize = 6;
/// @brief Insert the requested number of trampolines into the given module.
/// @param M Module to insert the call block into.
/// @param NumCalls Number of calls to create in the call block.
/// @param StartIndex Optional argument specifying the index suffix to start
/// with.
/// @return A functor that provides the symbol name for each entry in the call
/// block.
///
static LabelNameFtor insertCompileCallbackTrampolines(
Module &M,
TargetAddress TrampolineAddr,
unsigned NumCalls,
unsigned StartIndex = 0);
};
}
#endif // LLVM_EXECUTIONENGINE_ORC_ORCTARGETSUPPORT_H