Target: Eliminate a use of getDarwinMajorNumber().
authorDaniel Dunbar <daniel@zuster.org>
Tue, 19 Apr 2011 20:44:08 +0000 (20:44 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 19 Apr 2011 20:44:08 +0000 (20:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129803 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetLibraryInfo.cpp

index 90ea343322fe0bc12b2f6fa93f878d9ad492f145..104c5d4068e1ce1f7dcffc10aca8010119c4a865 100644 (file)
@@ -28,8 +28,15 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T) {
 
   
   // memset_pattern16 is only available on iOS 3.0 and Mac OS/X 10.5 and later.
-  if (T.getOS() != Triple::Darwin || T.getDarwinMajorNumber() < 9)
+  if (T.isOSX()) {
+    if (T.isOSXVersionLT(10, 5))
+      TLI.setUnavailable(LibFunc::memset_pattern16);
+  } else if (T.getOS() == Triple::IOS) {
+    if (T.isOSVersionLT(3, 0))
+      TLI.setUnavailable(LibFunc::memset_pattern16);
+  } else {
     TLI.setUnavailable(LibFunc::memset_pattern16);
+  }
 
   // iprintf and friends are only available on XCore.
   if (T.getArch() != Triple::xcore) {