1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[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
This commit is contained in:
Simon Pilgrim 2018-04-18 13:39:03 +00:00
parent 128a6355b2
commit 6133119928

View File

@ -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.