[llvm] r284657 - [BuildingAJIT] Use the remote target triple to construct the TargetMachine in

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 15:41:03 PDT 2016


Author: lhames
Date: Wed Oct 19 17:41:03 2016
New Revision: 284657

URL: http://llvm.org/viewvc/llvm-project?rev=284657&view=rev
Log:
[BuildingAJIT] Use the remote target triple to construct the TargetMachine in
Chapter 5.

Chapter 5 demonstrates remote JITing: code is executed on the remote, not the
machine running the REPL, so it's the remote's triple (and TargetMachine) that
we need.


Modified:
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h?rev=284657&r1=284656&r2=284657&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h Wed Oct 19 17:41:03 2016
@@ -87,7 +87,8 @@ public:
   typedef decltype(OptimizeLayer)::ModuleSetHandleT ModuleHandle;
 
   KaleidoscopeJIT(MyRemote &Remote)
-      : TM(EngineBuilder().selectTarget()),
+      : TM(EngineBuilder().selectTarget(Triple(Remote.getTargetTriple()), "",
+                                        "", SmallVector<std::string, 0>())),
         DL(TM->createDataLayout()),
         CompileLayer(ObjectLayer, SimpleCompiler(*TM)),
         OptimizeLayer(CompileLayer,




More information about the llvm-commits mailing list