diff options
Diffstat (limited to 'llvm/examples/ParallelJIT/ParallelJIT.cpp')
-rw-r--r-- | llvm/examples/ParallelJIT/ParallelJIT.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/examples/ParallelJIT/ParallelJIT.cpp b/llvm/examples/ParallelJIT/ParallelJIT.cpp index 2aa63d91ffb..b05e518ec41 100644 --- a/llvm/examples/ParallelJIT/ParallelJIT.cpp +++ b/llvm/examples/ParallelJIT/ParallelJIT.cpp @@ -243,13 +243,14 @@ int main() { LLVMContext Context; // Create some module to put our function into it. - Module *M = new Module("test", Context); + std::unique_ptr<Module> Owner = make_unique<Module>("test", Context); + Module *M = Owner.get(); Function* add1F = createAdd1( M ); Function* fibF = CreateFibFunction( M ); // Now we create the JIT. - ExecutionEngine* EE = EngineBuilder(M).create(); + ExecutionEngine* EE = EngineBuilder(std::move(Owner)).create(); //~ std::cout << "We just constructed this LLVM module:\n\n" << *M; //~ std::cout << "\n\nRunning foo: " << std::flush; |