1 //===-- MCJIT.h - Class definition for the MCJIT ----------------*- 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 #ifndef LLVM_LIB_EXECUTIONENGINE_MCJIT_H
11 #define LLVM_LIB_EXECUTIONENGINE_MCJIT_H
13 #include "llvm/ExecutionEngine/ExecutionEngine.h"
17 class MCJIT : public ExecutionEngine {
18 MCJIT(Module *M, TargetMachine &tm, TargetJITInfo &tji,
19 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel,
20 bool AllocateGVsWithCode);
24 /// @name ExecutionEngine interface implementation
27 virtual void *getPointerToBasicBlock(BasicBlock *BB);
29 virtual void *getPointerToFunction(Function *F);
31 virtual void *recompileAndRelinkFunction(Function *F);
33 virtual void freeMachineCodeForFunction(Function *F);
35 virtual GenericValue runFunction(Function *F,
36 const std::vector<GenericValue> &ArgValues);
39 /// @name (Private) Registration Interfaces
42 static void Register() {
43 MCJITCtor = createJIT;
46 // FIXME: This routine is scheduled for termination. Do not use it.
47 static TargetMachine *selectTarget(Module *M,
50 const SmallVectorImpl<std::string>& MAttrs,
53 static ExecutionEngine *createJIT(Module *M,
54 std::string *ErrorStr,
55 JITMemoryManager *JMM,
56 CodeGenOpt::Level OptLevel,
61 const SmallVectorImpl<std::string>& MAttrs);
66 } // End llvm namespace