summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/lli.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-09-30 19:12:23 +0000
committerLang Hames <lhames@gmail.com>2018-09-30 19:12:23 +0000
commitd435ce4343267e147289aa8d8264d308c6639647 (patch)
tree6172459f46f6491e0f081233b485dbbf9745b6a1 /llvm/tools/lli/lli.cpp
parent0f8f0d6d1df8d17765ea5b34b117d85142b2bf24 (diff)
downloadbcm5719-llvm-d435ce4343267e147289aa8d8264d308c6639647.tar.gz
bcm5719-llvm-d435ce4343267e147289aa8d8264d308c6639647.zip
[ORC] Extract and tidy up JITTargetMachineBuilder, add unit test.
(1) Adds comments for the API. (2) Removes the setArch method: This is redundant: the setArchStr method on the triple should be used instead. (3) Turns EmulatedTLS on by default. This matches EngineBuilder's behavior. llvm-svn: 343423
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r--llvm/tools/lli/lli.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 18cb661b9ef..9b3c7478b41 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -26,6 +26,7 @@
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/ObjectCache.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
+#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h"
#include "llvm/ExecutionEngine/OrcMCJITReplacement.h"
@@ -773,8 +774,10 @@ int runOrcLazyJIT(const char *ProgName) {
TT.empty() ? ExitOnErr(orc::JITTargetMachineBuilder::detectHost())
: orc::JITTargetMachineBuilder(Triple(TT));
- JTMB.setArch(MArch)
- .setCPU(getCPUStr())
+ if (!MArch.empty())
+ JTMB.getTargetTriple().setArchName(MArch);
+
+ JTMB.setCPU(getCPUStr())
.addFeatures(getFeatureList())
.setRelocationModel(RelocModel.getNumOccurrences()
? Optional<Reloc::Model>(RelocModel)
@@ -782,6 +785,7 @@ int runOrcLazyJIT(const char *ProgName) {
.setCodeModel(CMModel.getNumOccurrences()
? Optional<CodeModel::Model>(CMModel)
: None);
+
DataLayout DL("");
{
// Create a throwaway TargetMachine to get the data layout.
OpenPOWER on IntegriCloud