summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSebastian Pop <spop@codeaurora.org>2012-01-05 18:28:46 +0000
committerSebastian Pop <spop@codeaurora.org>2012-01-05 18:28:46 +0000
commit6e9b5eb51bb623995c90295d265a7682277653a1 (patch)
treec333ba442ddedfb74ac79b9a5f8541e2d0f3fafb /lib
parent0fcccd4d45b593bc11e56ff5be36a04836749376 (diff)
downloadllvm-6e9b5eb51bb623995c90295d265a7682277653a1.tar.gz
llvm-6e9b5eb51bb623995c90295d265a7682277653a1.tar.bz2
llvm-6e9b5eb51bb623995c90295d265a7682277653a1.tar.xz
revert r147542 after comments from Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/CommandLine.cpp1
-rw-r--r--lib/Support/TargetRegistry.cpp2
-rw-r--r--lib/Support/Unix/Host.inc18
-rw-r--r--lib/Support/Windows/Host.inc4
4 files changed, 7 insertions, 18 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index 9e8207baa8..ce9344954b 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -1373,7 +1373,6 @@ public:
<< " Built " << __DATE__ << " (" << __TIME__ << ").\n"
#endif
<< " Default target: " << sys::getDefaultTargetTriple() << '\n'
- << " Host: " << sys::getHostTriple() << '\n'
<< " Host CPU: " << CPU << '\n';
}
void operator=(bool OptionWasSpecified) {
diff --git a/lib/Support/TargetRegistry.cpp b/lib/Support/TargetRegistry.cpp
index 7497bfe035..53c8d84e7d 100644
--- a/lib/Support/TargetRegistry.cpp
+++ b/lib/Support/TargetRegistry.cpp
@@ -84,7 +84,7 @@ void TargetRegistry::RegisterTarget(Target &T,
}
const Target *TargetRegistry::getClosestTargetForJIT(std::string &Error) {
- const Target *TheTarget = lookupTarget(sys::getHostTriple(), Error);
+ const Target *TheTarget = lookupTarget(sys::getDefaultTargetTriple(), Error);
if (TheTarget && !TheTarget->hasJIT()) {
Error = "No JIT compatible target available for this host";
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc
index 82f717fc39..726e2fbcf0 100644
--- a/lib/Support/Unix/Host.inc
+++ b/lib/Support/Unix/Host.inc
@@ -35,9 +35,13 @@ static std::string getOSVersion() {
return info.release;
}
-std::string getTriple(StringRef &TripleString) {
- std::pair<StringRef, StringRef> ArchSplit = TripleString.split('-');
+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 Arch = ArchSplit.first;
+
std::string Triple(Arch);
Triple += '-';
Triple += ArchSplit.second;
@@ -57,13 +61,3 @@ std::string getTriple(StringRef &TripleString) {
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);
-}
diff --git a/lib/Support/Windows/Host.inc b/lib/Support/Windows/Host.inc
index cce82349cd..2e6d6f1903 100644
--- a/lib/Support/Windows/Host.inc
+++ b/lib/Support/Windows/Host.inc
@@ -20,7 +20,3 @@ using namespace llvm;
std::string sys::getDefaultTargetTriple() {
return LLVM_DEFAULT_TARGET_TRIPLE;
}
-
-std::string sys::getHostTriple() {
- return LLVM_HOST_TRIPLE;
-}