]> granicus.if.org Git - clang/commitdiff
Driver/Darwin: Resolve deployment target defaulting to be more predictable;
authorDaniel Dunbar <daniel@zuster.org>
Thu, 15 Jul 2010 16:18:06 +0000 (16:18 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 15 Jul 2010 16:18:06 +0000 (16:18 +0000)
assume we are targetting OS X unless an explicit option is given.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108426 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
test/Driver/darwin-iphone-defaults.m
test/Frontend/darwin-version.c

index 78763397eee6d6596e78b5bdd5c3c4680762f761..a78d1536fa1eafb94e2cf86b276a459d734fd6a9 100644 (file)
@@ -469,19 +469,10 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
       iPhoneVersion = DAL->MakeJoinedArg(0, O, iPhoneOSTarget);
       DAL->append(iPhoneVersion);
     } else {
-      // Otherwise, choose a default platform based on the tool chain.
-      //
-      // FIXME: Don't hardcode default here.
-      if (getTriple().getArch() == llvm::Triple::arm ||
-          getTriple().getArch() == llvm::Triple::thumb) {
-        const Option *O = Opts.getOption(options::OPT_miphoneos_version_min_EQ);
-        iPhoneVersion = DAL->MakeJoinedArg(0, O, "3.0");
-        DAL->append(iPhoneVersion);
-      } else {
-        const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
-        OSXVersion = DAL->MakeJoinedArg(0, O, MacosxVersionMin);
-        DAL->append(OSXVersion);
-      }
+      // Otherwise, assume we are targeting OS X.
+      const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
+      OSXVersion = DAL->MakeJoinedArg(0, O, MacosxVersionMin);
+      DAL->append(OSXVersion);
     }
   }
 
index 97ac4a42a54b3664b3752aa1ef390b372d53a097..62a9403900138f1698e4976f492f2ef4275d7896 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch armv7 -flto -S -o - %s | FileCheck %s
+// RUN: %clang -ccc-host-triple i386-apple-darwin9 -miphoneos-version-min=3.0 -arch armv7 -flto -S -o - %s | FileCheck %s
 
 // CHECK: @f0
 // CHECK-NOT: ssp
index 1c866ee096010234c1e6fd9f0e35993474047434..151d3a9f4770acbc1630af401ad6d7c6c4947f6f 100644 (file)
@@ -1,4 +1,7 @@
 // RUN: %clang -ccc-host-triple armv6-apple-darwin9 -dM -E -o %t %s
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
+// RUN: %clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=3.0 -dM -E -o %t %s
 // RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '30000' | count 1
 // RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0
 // RUN: %clang -ccc-host-triple armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t %s