From 99ab273a778d4836981f71dd7c947785dc3816b8 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Thu, 5 Jan 2012 18:28:46 +0000 Subject: revert r147542 after comments from Joerg Sonnenberger llvm-svn: 147608 --- llvm/lib/Support/Unix/Host.inc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Support/Unix') 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 ArchSplit = TripleString.split('-'); +std::string sys::getDefaultTargetTriple() { + StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE); + std::pair 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); -} -- cgit v1.2.3