[llvm-commits] [llvm] r169405 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
Bob Wilson
bob.wilson at apple.com
Wed Dec 5 11:09:13 PST 2012
Author: bwilson
Date: Wed Dec 5 13:09:13 2012
New Revision: 169405
URL: http://llvm.org/viewvc/llvm-project?rev=169405&view=rev
Log:
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>
Modified:
llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
Modified: llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp?rev=169405&r1=169404&r2=169405&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp Wed Dec 5 13:09:13 2012
@@ -32,8 +32,18 @@
// 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);
}
More information about the llvm-commits
mailing list