[llvm] r330255 - [llvm-exegesis] Pull out LLVMTargetMachine to simplify debugging. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 06:39:03 PDT 2018


Author: rksimon
Date: Wed Apr 18 06:39:03 2018
New Revision: 330255

URL: http://llvm.org/viewvc/llvm-project?rev=330255&view=rev
Log:
[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.

Modified:
    llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.cpp

Modified: llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.cpp?rev=330255&r1=330254&r2=330255&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/InMemoryAssembler.cpp Wed Apr 18 06:39:03 2018
@@ -202,6 +202,7 @@ JitFunction::JitFunction(JitFunctionCont
   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(JitFunctionCont
           .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.




More information about the llvm-commits mailing list