Make it explicit that ExecutionEngine takes ownership of the modules.
[oota-llvm.git] / lib / ExecutionEngine / JIT / JIT.h
index 4a10ca4d379b6786f144a5c9d842884f21027c42..c3bc740d7ecab508eb34909509c62c01f3089d32 100644 (file)
@@ -78,7 +78,7 @@ class JIT : public ExecutionEngine {
   BasicBlockAddressMapTy BasicBlockAddressMap;
 
 
   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();
       JITMemoryManager *JMM, bool AllocateGVsWithCode);
 public:
   ~JIT();
@@ -91,7 +91,7 @@ public:
   ///
   TargetJITInfo &getJITInfo() const { return TJI; }
 
   ///
   TargetJITInfo &getJITInfo() const { return TJI; }
 
-  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.
 
   /// removeModule - Remove a Module from the list of modules.  Returns true if
   /// M is found.
@@ -167,7 +167,7 @@ public:
   ///
   JITCodeEmitter *getCodeEmitter() const { return JCE; }
 
   ///
   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,
                                     std::string *ErrorStr,
                                     JITMemoryManager *JMM,
                                     bool GVsWithCode,