diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:17:27 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:17:27 +0000 |
commit | 67c32a98315f785a9ec9d531c1f571a0196c7463 (patch) | |
tree | 4abb9cbeecc7901726dd0b4a37369596c852e9ef /examples/ExceptionDemo/ExceptionDemo.cpp | |
parent | 9f61947910e6ab40de38e6b4034751ef1513200f (diff) |
Diffstat (limited to 'examples/ExceptionDemo/ExceptionDemo.cpp')
-rw-r--r-- | examples/ExceptionDemo/ExceptionDemo.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index 24e538cacf203..d50c7769526d9 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1957,17 +1957,17 @@ int main(int argc, char *argv[]) { llvm::IRBuilder<> theBuilder(context); // Make the module, which holds all the code. - llvm::Module *module = new llvm::Module("my cool jit", context); + std::unique_ptr<llvm::Module> Owner = + llvm::make_unique<llvm::Module>("my cool jit", context); + llvm::Module *module = Owner.get(); - llvm::RTDyldMemoryManager *MemMgr = new llvm::SectionMemoryManager(); + std::unique_ptr<llvm::RTDyldMemoryManager> MemMgr(new llvm::SectionMemoryManager()); // Build engine with JIT - llvm::EngineBuilder factory(module); + llvm::EngineBuilder factory(std::move(Owner)); factory.setEngineKind(llvm::EngineKind::JIT); - factory.setAllocateGVsWithCode(false); factory.setTargetOptions(Opts); - factory.setMCJITMemoryManager(MemMgr); - factory.setUseMCJIT(true); + factory.setMCJITMemoryManager(std::move(MemMgr)); llvm::ExecutionEngine *executionEngine = factory.create(); { @@ -1977,7 +1977,7 @@ int main(int argc, char *argv[]) { // Start with registering info about how the // target lays out data structures. module->setDataLayout(executionEngine->getDataLayout()); - fpm.add(new llvm::DataLayoutPass(module)); + fpm.add(new llvm::DataLayoutPass()); // Optimizations turned on #ifdef ADD_OPT_PASSES |