summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
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
commit99ab273a778d4836981f71dd7c947785dc3816b8 (patch)
treebde22e1311c31f39e9535ad750f63938348f2acd /llvm/lib/Support/Unix
parent8ff6bc924fbff00b63b84a8bd00cb0fd85265087 (diff)
downloadbcm5719-llvm-99ab273a778d4836981f71dd7c947785dc3816b8.tar.gz
bcm5719-llvm-99ab273a778d4836981f71dd7c947785dc3816b8.zip
revert r147542 after comments from Joerg Sonnenberger
llvm-svn: 147608
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Host.inc18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/Support/Unix/Host.inc b/llvm/lib/Support/Unix/Host.inc
index 82f717fc39b..726e2fbcf05 100644
--- a/llvm/lib/Support/Unix/Host.inc
+++ b/llvm/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);
-}
OpenPOWER on IntegriCloud