[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
This commit is contained in:
Lang Hames 2016-10-19 22:41:03 +00:00
parent db46b7d217
commit 1009b0b30f
1 changed files with 2 additions and 1 deletions

View File

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