From: Simon Pilgrim Date: Wed, 18 Apr 2018 13:39:03 +0000 (+0000) Subject: [llvm-exegesis] Pull out LLVMTargetMachine to simplify debugging. NFCI. X-Git-Tag: llvmorg-7.0.0-rc1~7986 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=715596df1fd668941fb6c6321cc2e047d3685375;p=platform%2Fupstream%2Fllvm.git [llvm-exegesis] Pull out LLVMTargetMachine to simplify debugging. NFCI. Has been useful while trying to get around all the error reporting issues mentioned on PR37049. llvm-svn: 330255 --- diff --git a/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp b/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp index 00b7ee7..f110d00 100644 --- a/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp +++ b/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp @@ -202,6 +202,7 @@ JitFunction::JitFunction(JitFunctionContext &&Context, LLVMLinkInMCJIT(); uintptr_t CodeSize = 0; std::string Error; + llvm::LLVMTargetMachine *TM = FunctionContext.TM.release(); ExecEngine.reset( llvm::EngineBuilder(std::move(FunctionContext.Module)) .setErrorStr(&Error) @@ -209,7 +210,7 @@ JitFunction::JitFunction(JitFunctionContext &&Context, .setEngineKind(llvm::EngineKind::JIT) .setMCJITMemoryManager( llvm::make_unique(&CodeSize)) - .create(FunctionContext.TM.release())); + .create(TM)); if (!ExecEngine) llvm::report_fatal_error(Error); // Adding the generated object file containing the assembled function.