Make it explicit that ExecutionEngine takes ownership of the modules.
[oota-llvm.git] / unittests / ExecutionEngine / MCJIT / MCJITTestBase.h
index 82d7f3550d27da260d3cef0cc489faad16267fe8..1a365793a5cdcd2df5907075227ca64da89c4329 100644 (file)
@@ -307,13 +307,13 @@ protected:
     UnsupportedEnvironments.push_back(Triple::Cygnus);
   }
 
-  void createJIT(Module *M) {
+  void createJIT(std::unique_ptr<Module> M) {
 
     // Due to the EngineBuilder constructor, it is required to have a Module
     // in order to construct an ExecutionEngine (i.e. MCJIT)
     assert(M != 0 && "a non-null Module must be provided to create MCJIT");
 
-    EngineBuilder EB(M);
+    EngineBuilder EB(std::move(M));
     std::string Error;
     TheJIT.reset(EB.setEngineKind(EngineKind::JIT)
                  .setUseMCJIT(true) /* can this be folded into the EngineKind enum? */