[llvm] r302011 - [Triple] Add a "macos" OS type that acts as a synonym for "macosx"
Alex Lorenz via llvm-commits
llvm-commits at lists.llvm.org
Wed May 3 03:42:36 PDT 2017
Author: arphaman
Date: Wed May 3 05:42:35 2017
New Revision: 302011
URL: http://llvm.org/viewvc/llvm-project?rev=302011&view=rev
Log:
[Triple] Add a "macos" OS type that acts as a synonym for "macosx"
The "macosx" OS type is still the canonical type. In the future "macos" will
become the canonical OS type (but we will still support "macosx").
rdar://27043820
Differential Revision: https://reviews.llvm.org/D32748
Modified:
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/test/CodeGen/X86/version_directive.ll
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=302011&r1=302010&r2=302011&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Wed May 3 05:42:35 2017
@@ -459,7 +459,7 @@ static Triple::OSType parseOS(StringRef
.StartsWith("kfreebsd", Triple::KFreeBSD)
.StartsWith("linux", Triple::Linux)
.StartsWith("lv2", Triple::Lv2)
- .StartsWith("macosx", Triple::MacOSX)
+ .StartsWith("macos", Triple::MacOSX)
.StartsWith("netbsd", Triple::NetBSD)
.StartsWith("openbsd", Triple::OpenBSD)
.StartsWith("solaris", Triple::Solaris)
@@ -984,6 +984,8 @@ void Triple::getOSVersion(unsigned &Majo
StringRef OSTypeName = getOSTypeName(getOS());
if (OSName.startswith(OSTypeName))
OSName = OSName.substr(OSTypeName.size());
+ else if (getOS() == MacOSX)
+ OSName.consume_front("macos");
parseVersionFromName(OSName, Major, Minor, Micro);
}
Modified: llvm/trunk/test/CodeGen/X86/version_directive.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/version_directive.ll?rev=302011&r1=302010&r2=302011&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/version_directive.ll (original)
+++ llvm/trunk/test/CodeGen/X86/version_directive.ll Wed May 3 05:42:35 2017
@@ -1,4 +1,5 @@
; RUN: llc -mtriple x86_64-apple-darwin15.0.0 -o - /dev/null | FileCheck %s
; RUN: llc -mtriple x86_64-apple-macosx10.11.0 -o - /dev/null | FileCheck %s
+; RUN: llc -mtriple x86_64-apple-macos10.11.0 -o - /dev/null | FileCheck %s
; CHECK: .macosx_version_min 10, 11
More information about the llvm-commits
mailing list