diff options
author | Hans Wennborg <hans@hanshq.net> | 2017-08-11 01:41:23 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2017-08-11 01:41:23 +0000 |
commit | ad0ce25f78a95689d1bbe14512f69badb22a43df (patch) | |
tree | 832f373fbe311a10b269bc23c0e3fa54b0f148ef /lib | |
parent | 6a4d8ba324f430182d7fe0eeeb1227138e4cc5fa (diff) |
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
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@310675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Driver/ToolChains/Darwin.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/Driver/ToolChains/Darwin.cpp b/lib/Driver/ToolChains/Darwin.cpp index 0d63858f2c..3db84ee1e6 100644 --- a/lib/Driver/ToolChains/Darwin.cpp +++ b/lib/Driver/ToolChains/Darwin.cpp @@ -1179,7 +1179,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { 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(DerivedArgList &Args) const { 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(DerivedArgList &Args) const { 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(DerivedArgList &Args) const { 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 || |