[cfe-commits] r149455 - in /cfe/trunk: lib/Basic/Targets.cpp test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m test/CodeGenCXX/arm.cpp test/Sema/attr-availability-ios.c

Bob Wilson bob.wilson at apple.com
Tue Jan 31 15:52:59 PST 2012


Author: bwilson
Date: Tue Jan 31 17:52:58 2012
New Revision: 149455

URL: http://llvm.org/viewvc/llvm-project?rev=149455&view=rev
Log:
Use the new Triple::getMacOSXVersion function in another place.

I removed support for "*-darwin*-iphoneos" triples, since we now have
iOS listed as a separate OS in the triples.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
    cfe/trunk/test/CodeGenCXX/arm.cpp
    cfe/trunk/test/Sema/attr-availability-ios.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=149455&r1=149454&r2=149455&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Jan 31 17:52:58 2012
@@ -119,33 +119,12 @@
 
   // Get the platform type and version number from the triple.
   unsigned Maj, Min, Rev;
-
-  // If no version was given, default to to 10.4.0, for simplifying tests.
-  if (Triple.getOSName() == "darwin" || Triple.getOSName() == "osx") {
+  if (Triple.isMacOSX()) {
+    Triple.getMacOSXVersion(Maj, Min, Rev);
     PlatformName = "macosx";
-    Min = Rev = 0;
-    Maj = 8;
   } else {
-    // Otherwise, honor all three triple forms ("-darwinNNN[-iphoneos]",
-    // "-osxNNN", and "-iosNNN").
-
-    if (Triple.getOS() == llvm::Triple::Darwin) {
-      // For historical reasons that make little sense, the version passed here
-      // is the "darwin" version, which drops the 10 and offsets by 4.
-      Triple.getOSVersion(Maj, Min, Rev);
-
-      if (Triple.getEnvironmentName() == "iphoneos") {
-        PlatformName = "ios";
-      } else {
-        PlatformName = "macosx";
-        Rev = Min;
-        Min = Maj - 4;
-        Maj = 10;
-      }
-    } else {
-      Triple.getOSVersion(Maj, Min, Rev);
-      PlatformName = llvm::Triple::getOSTypeName(Triple.getOS());
-    }
+    Triple.getOSVersion(Maj, Min, Rev);
+    PlatformName = llvm::Triple::getOSTypeName(Triple.getOS());
   }
 
   // If -target arch-pc-win32-macho option specified, we're
@@ -157,7 +136,7 @@
   }
 
   // Set the appropriate OS version define.
-  if (PlatformName == "ios") {
+  if (Triple.getOS() == llvm::Triple::IOS) {
     assert(Maj < 10 && Min < 100 && Rev < 100 && "Invalid version!");
     char Str[6];
     Str[0] = '0' + Maj;

Modified: cfe/trunk/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m?rev=149455&r1=149454&r2=149455&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m (original)
+++ cfe/trunk/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m Tue Jan 31 17:52:58 2012
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple i386-apple-darwin8 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin8 %s
 // RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin9 %s
-// RUN: %clang_cc1 -triple thumbv6-apple-darwin4.0.0-iphoneos -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin9 %s
+// RUN: %clang_cc1 -triple thumbv6-apple-ios4.0 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=basic -analyzer-store=region %s 2>&1 | FileCheck -check-prefix=darwin9 %s
 
 @interface MyClass {}
 - (void *)voidPtrM;

Modified: cfe/trunk/test/CodeGenCXX/arm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/arm.cpp?rev=149455&r1=149454&r2=149455&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/arm.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/arm.cpp Tue Jan 31 17:52:58 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=thumbv7-apple-darwin3.0.0-iphoneos -fno-use-cxa-atexit -target-abi apcs-gnu -emit-llvm -o - -fexceptions | FileCheck %s
+// RUN: %clang_cc1 %s -triple=thumbv7-apple-ios3.0 -fno-use-cxa-atexit -target-abi apcs-gnu -emit-llvm -o - -fexceptions | FileCheck %s
 
 // CHECK: @_ZZN5test74testEvE1x = internal global i32 0, align 4
 // CHECK: @_ZGVZN5test74testEvE1x = internal global i32 0

Modified: cfe/trunk/test/Sema/attr-availability-ios.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-availability-ios.c?rev=149455&r1=149454&r2=149455&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-availability-ios.c (original)
+++ cfe/trunk/test/Sema/attr-availability-ios.c Tue Jan 31 17:52:58 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s
+// RUN: %clang_cc1 "-triple" "x86_64-apple-ios3.0" -fsyntax-only -verify %s
 
 void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1)));
 void f1(int) __attribute__((availability(ios,introduced=2.1)));





More information about the cfe-commits mailing list