Skip to content

Commit 06bd1ba

Browse files
committed
[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/trunk@309607 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 4633b85c2c9915c7b57fb2327912a0cc59e1b077) Conflicts: lib/Driver/ToolChains/Darwin.cpp apple-llvm-split-commit: e8adf5b68976d706116bb2f5fbf8e583179283fb apple-llvm-split-dir: clang/
1 parent 395a64f commit 06bd1ba

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ def err_drv_cc_print_options_failure : Error<
135135
"unable to open CC_PRINT_OPTIONS file: %0">;
136136
def err_drv_preamble_format : Error<
137137
"incorrect format for -preamble-bytes=N,END">;
138-
def err_invalid_ios_deployment_target : Error<
138+
def warn_invalid_ios_deployment_target : Warning<
139139
"invalid iOS deployment version '%0', iOS 10 is the maximum deployment "
140-
"target for 32-bit targets">;
140+
"target for 32-bit targets">, InGroup<InvalidIOSDeploymentTarget>,
141+
DefaultError;
141142
def err_drv_conflicting_deployment_targets : Error<
142143
"conflicting deployment targets, both '%0' and '%1' are present in environment">;
143144
def err_arc_unsupported_on_runtime : Error<

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
146146
def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
147147
def FormatExtraArgs : DiagGroup<"format-extra-args">;
148148
def FormatZeroLength : DiagGroup<"format-zero-length">;
149+
150+
def InvalidIOSDeploymentTarget : DiagGroup<"invalid-ios-deployment-target">;
151+
149152
def CXX1zCompatMangling : DiagGroup<"c++1z-compat-mangling">;
150153

151154
// Warnings for C++1y code which is not compatible with prior C++ standards.

clang/lib/Driver/ToolChains.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
601601
Driver::GetReleaseVersion(iOSVersion->getValue(), Major, Minor, Micro,
602602
HadExtra) &&
603603
Major > 10)
604-
getDriver().Diag(diag::err_invalid_ios_deployment_target)
604+
getDriver().Diag(diag::warn_invalid_ios_deployment_target)
605605
<< iOSVersion->getAsString(Args);
606606

607607
// Add a macro to differentiate between m(iphone|tv|watch)os-version-min=X.Y and
@@ -650,7 +650,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
650650
Driver::GetReleaseVersion(iOSTarget.c_str(), Major, Minor, Micro,
651651
HadExtra) &&
652652
Major > 10)
653-
getDriver().Diag(diag::err_invalid_ios_deployment_target)
653+
getDriver().Diag(diag::warn_invalid_ios_deployment_target)
654654
<< std::string("IPHONEOS_DEPLOYMENT_TARGET=") + iOSTarget;
655655

656656
// If there is no command-line argument to specify the Target version and

clang/test/Driver/darwin-version.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS11 %s
4646
// CHECK-VERSION-IOS11: arm64-apple-ios11.1.0
4747

48+
// RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0 -c -Wno-invalid-ios-deployment-target -### %s 2>&1 | \
49+
// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS12 %s
50+
// CHECK-VERSION-IOS12: thumbv7-apple-ios11.0.0
51+
4852
// RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \
4953
// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
5054
// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -c %s -### 2>&1 | \

0 commit comments

Comments
 (0)