diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
commit | 63faed5b8e4f2755f127fcb8aa440480c0649327 (patch) | |
tree | 19c69a04768629f2d440944b71cbe90adae0b615 /lib/Support/Unix/Host.inc | |
parent | d4c8b5d2e851b0e8a063c6bf8543a4823a26c15a (diff) |
Diffstat (limited to 'lib/Support/Unix/Host.inc')
-rw-r--r-- | lib/Support/Unix/Host.inc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc index dda3ce2c6f97..726e2fbcf056 100644 --- a/lib/Support/Unix/Host.inc +++ b/lib/Support/Unix/Host.inc @@ -35,14 +35,11 @@ static std::string getOSVersion() { return info.release; } -std::string sys::getHostTriple() { - // FIXME: Derive directly instead of relying on the autoconf generated - // variable. +std::string sys::getDefaultTargetTriple() { + StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE); + std::pair<StringRef, StringRef> ArchSplit = TargetTripleString.split('-'); - StringRef HostTripleString(LLVM_HOSTTRIPLE); - std::pair<StringRef, StringRef> ArchSplit = HostTripleString.split('-'); - - // Normalize the arch, since the host triple may not actually match the host. + // Normalize the arch, since the target triple may not actually match the target. std::string Arch = ArchSplit.first; std::string Triple(Arch); @@ -55,7 +52,7 @@ std::string sys::getHostTriple() { Triple[1] = '3'; // On darwin, we want to update the version to match that of the - // host. + // target. std::string::size_type DarwinDashIdx = Triple.find("-darwin"); if (DarwinDashIdx != std::string::npos) { Triple.resize(DarwinDashIdx + strlen("-darwin")); |