summaryrefslogtreecommitdiffstats
path: root/llvm/examples/ParallelJIT/ParallelJIT.cpp
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
commit2a8a2795ee8edb8120d10c3c2af397f429b13c57 (patch)
treef77e8ceaf358640f215dc0207854cb9d00975e08 /llvm/examples/ParallelJIT/ParallelJIT.cpp
parent687744d0114c46529def899ee6c67428cbdf3d92 (diff)
downloadbcm5719-llvm-2a8a2795ee8edb8120d10c3c2af397f429b13c57.tar.gz
bcm5719-llvm-2a8a2795ee8edb8120d10c3c2af397f429b13c57.zip
Make it explicit that ExecutionEngine takes ownership of the modules.
llvm-svn: 215967
Diffstat (limited to 'llvm/examples/ParallelJIT/ParallelJIT.cpp')
-rw-r--r--llvm/examples/ParallelJIT/ParallelJIT.cpp5
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;
OpenPOWER on IntegriCloud