diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-04-18 13:39:03 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-04-18 13:39:03 +0000 |
commit | 715596df1fd668941fb6c6321cc2e047d3685375 (patch) | |
tree | f8e81ca8d3c9b7ab94b6b0d5c56be9c4c668704d /llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp | |
parent | 536d2e30721e2b1690ac4018c033e36c096820bb (diff) | |
download | bcm5719-llvm-715596df1fd668941fb6c6321cc2e047d3685375.tar.gz bcm5719-llvm-715596df1fd668941fb6c6321cc2e047d3685375.zip |
[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
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp')
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp b/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.cpp index 00b7ee74ca0..f110d00451e 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<TrackingSectionMemoryManager>(&CodeSize)) - .create(FunctionContext.TM.release())); + .create(TM)); if (!ExecEngine) llvm::report_fatal_error(Error); // Adding the generated object file containing the assembled function. |