diff options
author | Sebastian Pop <spop@codeaurora.org> | 2012-01-04 19:47:22 +0000 |
---|---|---|
committer | Sebastian Pop <spop@codeaurora.org> | 2012-01-04 19:47:22 +0000 |
commit | 0f357d6c2240393b53d30cf79c2cd583192e5ed9 (patch) | |
tree | 642c100b83b81b7f83bfe293c75df67f1ebff3e3 /llvm/lib/Support/Unix | |
parent | aac3e06bf73214a1f44dd40e98c9930b759ded38 (diff) | |
download | bcm5719-llvm-0f357d6c2240393b53d30cf79c2cd583192e5ed9.tar.gz bcm5719-llvm-0f357d6c2240393b53d30cf79c2cd583192e5ed9.zip |
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.
llvm-svn: 147542
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Host.inc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/Support/Unix/Host.inc b/llvm/lib/Support/Unix/Host.inc index 726e2fbcf05..82f717fc39b 100644 --- a/llvm/lib/Support/Unix/Host.inc +++ b/llvm/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); +} |