summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-12-05 19:09:13 +0000
committerBob Wilson <bob.wilson@apple.com>2012-12-05 19:09:13 +0000
commit50a62525cdad081d3b8e0c0a78e4ebeb260bb563 (patch)
tree37029cec9caf780fcb4fc6b545326f01502a4255 /llvm/lib/ExecutionEngine
parentcd8c881c9f9264f5108c5f26fbbd988543966842 (diff)
downloadbcm5719-llvm-50a62525cdad081d3b8e0c0a78e4ebeb260bb563.tar.gz
bcm5719-llvm-50a62525cdad081d3b8e0c0a78e4ebeb260bb563.zip
Adjust JIT target triple on OS X to match the current architecture.
For OS X builds, we generate one version of config.h but then build for multiple architectures. This means that the LLVM_HOSTTRIPLE setting may have the wrong architecture. Adjust it dynamically to match the current architecture. <rdar://problem/12715470> llvm-svn: 169405
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/TargetSelect.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/TargetSelect.cpp b/llvm/lib/ExecutionEngine/TargetSelect.cpp
index f33cc54c7c3..4e52a98c332 100644
--- a/llvm/lib/ExecutionEngine/TargetSelect.cpp
+++ b/llvm/lib/ExecutionEngine/TargetSelect.cpp
@@ -32,8 +32,18 @@ TargetMachine *EngineBuilder::selectTarget() {
// must use the host architecture.
if (UseMCJIT && WhichEngine != EngineKind::Interpreter && M)
TT.setTriple(M->getTargetTriple());
- else
+ else {
TT.setTriple(LLVM_HOSTTRIPLE);
+#if defined(__APPLE__)
+#if defined(__LP64__)
+ if (TT.isArch32Bit())
+ TT = TT.get64BitArchVariant();
+#else
+ if (TT.isArch64Bit())
+ TT = TT.get32BitArchVariant();
+#endif
+#endif // APPLE
+ }
return selectTarget(TT, MArch, MCPU, MAttrs);
}
OpenPOWER on IntegriCloud