[llvm-branch-commits] [cfe-branch] r310675 - Merging r309607:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 10 18:41:23 PDT 2017


Author: hans
Date: Thu Aug 10 18:41:23 2017
New Revision: 310675

URL: http://llvm.org/viewvc/llvm-project?rev=310675&view=rev
Log:
Merging r309607:
------------------------------------------------------------------------
r309607 | ahatanak | 2017-07-31 12:16:40 -0700 (Mon, 31 Jul 2017) | 6 lines

[Driver] Allow users to silence the warning that is issued when the
deployment target is earlier than iOS 11 and the target is 32-bit.

This is a follow-up to r306922.

rdar://problem/32230613
------------------------------------------------------------------------

Modified:
    cfe/branches/release_50/   (props changed)
    cfe/branches/release_50/include/clang/Basic/DiagnosticDriverKinds.td
    cfe/branches/release_50/include/clang/Basic/DiagnosticGroups.td
    cfe/branches/release_50/lib/Driver/ToolChains/Darwin.cpp
    cfe/branches/release_50/test/Driver/darwin-version.c

Propchange: cfe/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 10 18:41:23 2017
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:308455,308722,308824,308897,308996,309058,309112-309113,309226,309263,309327,309382-309383,309488,309503,309523,309569,309722,309752,309975,310057,310158,310191,310359
+/cfe/trunk:308455,308722,308824,308897,308996,309058,309112-309113,309226,309263,309327,309382-309383,309488,309503,309523,309569,309607,309722,309752,309975,310057,310158,310191,310359
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_50/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/include/clang/Basic/DiagnosticDriverKinds.td?rev=310675&r1=310674&r2=310675&view=diff
==============================================================================
--- cfe/branches/release_50/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/branches/release_50/include/clang/Basic/DiagnosticDriverKinds.td Thu Aug 10 18:41:23 2017
@@ -138,9 +138,10 @@ def err_drv_cc_print_options_failure : E
 def err_drv_lto_without_lld : Error<"LTO requires -fuse-ld=lld">;
 def err_drv_preamble_format : Error<
     "incorrect format for -preamble-bytes=N,END">;
-def err_invalid_ios_deployment_target : Error<
+def warn_invalid_ios_deployment_target : Warning<
   "invalid iOS deployment version '%0', iOS 10 is the maximum deployment "
-  "target for 32-bit targets">;
+  "target for 32-bit targets">, InGroup<InvalidIOSDeploymentTarget>,
+  DefaultError;
 def err_drv_conflicting_deployment_targets : Error<
   "conflicting deployment targets, both '%0' and '%1' are present in environment">;
 def err_arc_unsupported_on_runtime : Error<

Modified: cfe/branches/release_50/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/include/clang/Basic/DiagnosticGroups.td?rev=310675&r1=310674&r2=310675&view=diff
==============================================================================
--- cfe/branches/release_50/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/branches/release_50/include/clang/Basic/DiagnosticGroups.td Thu Aug 10 18:41:23 2017
@@ -151,6 +151,9 @@ def GNUFlexibleArrayUnionMember : DiagGr
 def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
 def FormatExtraArgs : DiagGroup<"format-extra-args">;
 def FormatZeroLength : DiagGroup<"format-zero-length">;
+
+def InvalidIOSDeploymentTarget : DiagGroup<"invalid-ios-deployment-target">;
+
 def CXX1zCompatMangling : DiagGroup<"c++1z-compat-mangling">;
 // Name of this warning in GCC.
 def NoexceptType : DiagGroup<"noexcept-type", [CXX1zCompatMangling]>;

Modified: cfe/branches/release_50/lib/Driver/ToolChains/Darwin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/Driver/ToolChains/Darwin.cpp?rev=310675&r1=310674&r2=310675&view=diff
==============================================================================
--- cfe/branches/release_50/lib/Driver/ToolChains/Darwin.cpp (original)
+++ cfe/branches/release_50/lib/Driver/ToolChains/Darwin.cpp Thu Aug 10 18:41:23 2017
@@ -1179,7 +1179,7 @@ void Darwin::AddDeploymentTarget(Derived
       Driver::GetReleaseVersion(iOSVersion->getValue(), Major, Minor, Micro,
                                 HadExtra) &&
       Major > 10)
-    getDriver().Diag(diag::err_invalid_ios_deployment_target)
+    getDriver().Diag(diag::warn_invalid_ios_deployment_target)
         << iOSVersion->getAsString(Args);
 
   // Add a macro to differentiate between m(iphone|tv|watch)os-version-min=X.Y and
@@ -1228,7 +1228,7 @@ void Darwin::AddDeploymentTarget(Derived
         Driver::GetReleaseVersion(iOSTarget.c_str(), Major, Minor, Micro,
                                   HadExtra) &&
         Major > 10)
-      getDriver().Diag(diag::err_invalid_ios_deployment_target)
+      getDriver().Diag(diag::warn_invalid_ios_deployment_target)
           << std::string("IPHONEOS_DEPLOYMENT_TARGET=") + iOSTarget;
 
     // If there is no command-line argument to specify the Target version and
@@ -1298,6 +1298,15 @@ void Darwin::AddDeploymentTarget(Derived
           break;
         case llvm::Triple::IOS:
           getTriple().getiOSVersion(Major, Minor, Micro);
+
+          // iOS 10 is the maximum deployment target for 32-bit targets. If the
+          // inferred deployment target is iOS 11 or later, set it to 10.99.
+          if (getTriple().isArch32Bit() && Major >= 11) {
+            Major = 10;
+            Minor = 99;
+            Micro = 99;
+          }
+
           OSTarget = &iOSTarget;
           break;
         case llvm::Triple::TvOS:
@@ -1393,13 +1402,6 @@ void Darwin::AddDeploymentTarget(Derived
         HadExtra || Major >= 100 || Minor >= 100 || Micro >= 100)
       getDriver().Diag(diag::err_drv_invalid_version_number)
           << iOSVersion->getAsString(Args);
-    // iOS 10 is the maximum deployment target for 32-bit targets. If the
-    // inferred deployment target is iOS 11 or later, set it to 10.99.
-    if (getTriple().isArch32Bit() && Major >= 11) {
-      Major = 10;
-      Minor = 99;
-      Micro = 99;
-    }
   } else if (Platform == TvOS) {
     if (!Driver::GetReleaseVersion(TvOSVersion->getValue(), Major, Minor,
                                    Micro, HadExtra) || HadExtra ||

Modified: cfe/branches/release_50/test/Driver/darwin-version.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/test/Driver/darwin-version.c?rev=310675&r1=310674&r2=310675&view=diff
==============================================================================
--- cfe/branches/release_50/test/Driver/darwin-version.c (original)
+++ cfe/branches/release_50/test/Driver/darwin-version.c Thu Aug 10 18:41:23 2017
@@ -45,6 +45,10 @@
 // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS11 %s
 // CHECK-VERSION-IOS11: arm64-apple-ios11.1.0
 
+// RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0 -c -Wno-invalid-ios-deployment-target -### %s 2>&1 | \
+// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS12 %s
+// CHECK-VERSION-IOS12: thumbv7-apple-ios11.0.0
+
 // RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \
 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
 // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -c %s -### 2>&1 | \




More information about the llvm-branch-commits mailing list