summaryrefslogtreecommitdiff
path: root/lib/Support/Unix/Host.inc
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2012-01-04 19:47:22 +0000
committerSebastian Pop <spop@codeaurora.org>2012-01-04 19:47:22 +0000
commit8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a (patch)
treed063101aa566588fde106548beed730b9023ced8 /lib/Support/Unix/Host.inc
parentb0e7af779732c5ff3c054c837a4b04ad6089d0ac (diff)
downloadllvm-8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a.tar.gz
llvm-8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a.tar.bz2
llvm-8a86887ba3dcf59ddfd1d26bd2af1ac9c6bed76a.tar.xz
use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJIT
Get back getHostTriple. For JIT compilation, use the host triple instead of the default target: this fixes some JIT testcases that used to fail when the compiler has been configured as a cross compiler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix/Host.inc')
-rw-r--r--lib/Support/Unix/Host.inc18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc
index 726e2fbcf0..82f717fc39 100644
--- a/lib/Support/Unix/Host.inc
+++ b/lib/Support/Unix/Host.inc
@@ -35,13 +35,9 @@ static std::string getOSVersion() {
return info.release;
}
-std::string sys::getDefaultTargetTriple() {
- StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
- std::pair<StringRef, StringRef> ArchSplit = TargetTripleString.split('-');
-
- // Normalize the arch, since the target triple may not actually match the target.
+std::string getTriple(StringRef &TripleString) {
+ std::pair<StringRef, StringRef> ArchSplit = TripleString.split('-');
std::string Arch = ArchSplit.first;
-
std::string Triple(Arch);
Triple += '-';
Triple += ArchSplit.second;
@@ -61,3 +57,13 @@ std::string sys::getDefaultTargetTriple() {
return Triple;
}
+
+std::string sys::getDefaultTargetTriple() {
+ StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
+ return getTriple(TargetTripleString);
+}
+
+std::string sys::getHostTriple() {
+ StringRef HostTripleString(LLVM_HOST_TRIPLE);
+ return getTriple(HostTripleString);
+}