summaryrefslogtreecommitdiff
path: root/examples/ParallelJIT
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-19 04:04:25 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-19 04:04:25 +0000
commit3f4ed32b4398eaf4fe0080d8001ba01e6c2f43c8 (patch)
tree961679644a48b563e0febf6499460ea12c247b95 /examples/ParallelJIT
parent4d48c3f2a498d169af596871cd23ce7b6e961d43 (diff)
Make it explicit that ExecutionEngine takes ownership of the modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/ParallelJIT')
-rw-r--r--examples/ParallelJIT/ParallelJIT.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp
index 2aa63d91ffb..b05e518ec41 100644
--- a/examples/ParallelJIT/ParallelJIT.cpp
+++ b/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;