summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Support/Unix/Host.inc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Support/Unix/Host.inc')
-rw-r--r--contrib/llvm/lib/Support/Unix/Host.inc23
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/llvm/lib/Support/Unix/Host.inc b/contrib/llvm/lib/Support/Unix/Host.inc
index 1e438e7..7f79db0 100644
--- a/contrib/llvm/lib/Support/Unix/Host.inc
+++ b/contrib/llvm/lib/Support/Unix/Host.inc
@@ -26,6 +26,11 @@
using namespace llvm;
+#ifdef __FreeBSD__
+std::string sys::getDefaultTargetTriple() {
+ return LLVM_DEFAULT_TARGET_TRIPLE;
+}
+#else // __FreeBSD__
static std::string getOSVersion() {
struct utsname info;
@@ -35,17 +40,11 @@ static std::string getOSVersion() {
return info.release;
}
-std::string sys::getHostTriple() {
-#ifdef __FreeBSD__
- return LLVM_HOSTTRIPLE;
-#else
- // FIXME: Derive directly instead of relying on the autoconf generated
- // variable.
-
- StringRef HostTripleString(LLVM_HOSTTRIPLE);
- std::pair<StringRef, StringRef> ArchSplit = HostTripleString.split('-');
+std::string sys::getDefaultTargetTriple() {
+ StringRef TargetTripleString(LLVM_DEFAULT_TARGET_TRIPLE);
+ std::pair<StringRef, StringRef> ArchSplit = TargetTripleString.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);
@@ -58,7 +57,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"));
@@ -66,5 +65,5 @@ std::string sys::getHostTriple() {
}
return Triple;
-#endif
}
+#endif // __FreeBSD__
OpenPOWER on IntegriCloud