mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +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:
@@ -935,11 +935,13 @@ int main() {
|
||||
getNextToken();
|
||||
|
||||
// Make the module, which holds all the code.
|
||||
TheModule = new Module("my cool jit", Context);
|
||||
std::unique_ptr<Module> Owner = make_unique<Module>("my cool jit", Context);
|
||||
TheModule = Owner.get();
|
||||
|
||||
// Create the JIT. This takes ownership of the module.
|
||||
std::string ErrStr;
|
||||
TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create();
|
||||
TheExecutionEngine =
|
||||
EngineBuilder(std::move(Owner)).setErrorStr(&ErrStr).create();
|
||||
if (!TheExecutionEngine) {
|
||||
fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str());
|
||||
exit(1);
|
||||
|
Reference in New Issue
Block a user