Skip to content

Commit

Permalink
[Driver] Warn about all instances -mios-version-min not just the last
Browse files Browse the repository at this point in the history
Follow-up to D155123, uniformly handle cases where there are duplicate
-mios-verion-min arguments.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D155407
  • Loading branch information
porglezomp committed Jul 16, 2023
1 parent 1126cff commit f7ad7d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/Darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void darwin::setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str,
ArchKind == llvm::ARM::ArchKind::ARMV7EM) {
// Don't reject -mios-version-min= if we have an iOS triple.
if (T.isiOS())
if (Arg *A = Args.getLastArgNoClaim(options::OPT_mios_version_min_EQ))
for (Arg *A : Args.filtered(options::OPT_mios_version_min_EQ))
A->ignoreTargetSpecific();

T.setOS(llvm::Triple::UnknownOS);
Expand Down
1 change: 1 addition & 0 deletions clang/test/Driver/macho-embedded.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// RUN: %clang -arch armv7em -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACHO-EMBEDDED

// RUN: %clang -arch armv7m --target=thumbv7-apple-ios -mios-version-min=5 -fdriver-only -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACHO-EMBEDDED-DIAG
// RUN: %clang -arch armv7m --target=thumbv7-apple-ios -mios-version-min=5 -mios-version-min=5 -fdriver-only -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACHO-EMBEDDED-DIAG

// CHECK-IOS: "-triple" "thumbv7" "thumbv7-apple-ios

Expand Down

0 comments on commit f7ad7d1

Please sign in to comment.