From: Lang Hames Date: Wed, 19 Oct 2016 22:41:03 +0000 (+0000) Subject: [BuildingAJIT] Use the remote target triple to construct the TargetMachine in X-Git-Tag: llvmorg-4.0.0-rc1~6759 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1009b0b30fa791ee686d18498cdf7a7dde0e5c93;p=platform%2Fupstream%2Fllvm.git [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. llvm-svn: 284657 --- diff --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h index b122386..f11f036 100644 --- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h +++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h @@ -87,7 +87,8 @@ public: typedef decltype(OptimizeLayer)::ModuleSetHandleT ModuleHandle; KaleidoscopeJIT(MyRemote &Remote) - : TM(EngineBuilder().selectTarget()), + : TM(EngineBuilder().selectTarget(Triple(Remote.getTargetTriple()), "", + "", SmallVector())), DL(TM->createDataLayout()), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer,