mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
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
This commit is contained in:
@ -1957,12 +1957,14 @@ 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();
|
||||
|
||||
// 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);
|
||||
|
Reference in New Issue
Block a user