[CFLAA] LLVM_CONSTEXPR -> const
[oota-llvm.git] / lib / ExecutionEngine / JIT / JIT.h
index d2bd5089cb29396188c692af60f7e9c285df2607..c3bc740d7ecab508eb34909509c62c01f3089d32 100644 (file)
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef JIT_H
-#define JIT_H
+#ifndef LLVM_LIB_EXECUTIONENGINE_JIT_JIT_H
+#define LLVM_LIB_EXECUTIONENGINE_JIT_JIT_H
 
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
 #include "llvm/IR/ValueHandle.h"
@@ -39,12 +39,12 @@ private:
 public:
   explicit JITState(Module *M) : PM(M), M(M) {}
 
-  FunctionPassManager &getPM(const MutexGuard &L) {
+  FunctionPassManager &getPM() {
     return PM;
   }
 
   Module *getModule() const { return M; }
-  std::vector<AssertingVH<Function> > &getPendingFunctions(const MutexGuard &L){
+  std::vector<AssertingVH<Function> > &getPendingFunctions({
     return PendingFunctions;
   }
 };
@@ -78,7 +78,7 @@ class JIT : public ExecutionEngine {
   BasicBlockAddressMapTy BasicBlockAddressMap;
 
 
-  JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji,
+  JIT(std::unique_ptr<Module> M, TargetMachine &tm, TargetJITInfo &tji,
       JITMemoryManager *JMM, bool AllocateGVsWithCode);
 public:
   ~JIT();
@@ -91,22 +91,7 @@ public:
   ///
   TargetJITInfo &getJITInfo() const { return TJI; }
 
-  /// create - Create an return a new JIT compiler if there is one available
-  /// for the current target.  Otherwise, return null.
-  ///
-  static ExecutionEngine *create(Module *M,
-                                 std::string *Err,
-                                 JITMemoryManager *JMM,
-                                 CodeGenOpt::Level OptLevel =
-                                   CodeGenOpt::Default,
-                                 bool GVsWithCode = true,
-                                 Reloc::Model RM = Reloc::Default,
-                                 CodeModel::Model CMM = CodeModel::JITDefault) {
-    return ExecutionEngine::createJIT(M, Err, JMM, OptLevel, GVsWithCode,
-                                      RM, CMM);
-  }
-
-  void addModule(Module *M) override;
+  void addModule(std::unique_ptr<Module> M) override;
 
   /// removeModule - Remove a Module from the list of modules.  Returns true if
   /// M is found.
@@ -182,7 +167,7 @@ public:
   ///
   JITCodeEmitter *getCodeEmitter() const { return JCE; }
 
-  static ExecutionEngine *createJIT(Module *M,
+  static ExecutionEngine *createJIT(std::unique_ptr<Module> M,
                                     std::string *ErrorStr,
                                     JITMemoryManager *JMM,
                                     bool GVsWithCode,
@@ -205,7 +190,7 @@ public:
   void NotifyFreeingMachineCode(void *OldPtr);
 
   BasicBlockAddressMapTy &
-  getBasicBlockAddressMap(const MutexGuard &) {
+  getBasicBlockAddressMap() {
     return BasicBlockAddressMap;
   }
 
@@ -213,9 +198,9 @@ public:
 private:
   static JITCodeEmitter *createEmitter(JIT &J, JITMemoryManager *JMM,
                                        TargetMachine &tm);
-  void runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked);
-  void updateFunctionStub(Function *F);
-  void jitTheFunction(Function *F, const MutexGuard &locked);
+  void runJITOnFunctionUnlocked(Function *F);
+  void updateFunctionStubUnlocked(Function *F);
+  void jitTheFunctionUnlocked(Function *F);
 
 protected: