[PATCH] D113070: [lld-macho] Silently ignore the -objc_abi_version
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 12:19:39 PDT 2021
keith updated this revision to Diff 384555.
keith marked an inline comment as done.
keith added a comment.
Add test making sure flag doesn't warn
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113070/new/
https://reviews.llvm.org/D113070
Files:
lld/MachO/Driver.cpp
lld/MachO/Options.td
lld/test/MachO/silent-ignore.s
lld/test/MachO/silent-ignore.test
Index: lld/test/MachO/silent-ignore.test
===================================================================
--- lld/test/MachO/silent-ignore.test
+++ /dev/null
@@ -1,14 +0,0 @@
-RUN: %lld --version \
-RUN: -dynamic \
-RUN: -no_deduplicate \
-RUN: -lto_library /lib/foo \
-RUN: -macosx_version_min 0 \
-RUN: -no_dtrace_dof \
-RUN: -dependency_info /path/to/dependency_info.dat \
-RUN: -lto_library ../lib/libLTO.dylib \
-RUN: -mllvm -time-passes \
-RUN: -objc_abi_version 2 \
-RUN: -ios_simulator_version_min 9.0.0 \
-RUN: -sdk_version 13.2
-RUN: not %lld -v --not-an-ignored-argument 2>&1 | FileCheck %s
-CHECK: error: unknown argument '--not-an-ignored-argument'
Index: lld/test/MachO/silent-ignore.s
===================================================================
--- /dev/null
+++ lld/test/MachO/silent-ignore.s
@@ -0,0 +1,23 @@
+# REQUIRES: x86
+
+# RUN: %lld --version \
+# RUN: -dynamic \
+# RUN: -no_deduplicate \
+# RUN: -lto_library /lib/foo \
+# RUN: -macosx_version_min 0 \
+# RUN: -no_dtrace_dof \
+# RUN: -dependency_info /path/to/dependency_info.dat \
+# RUN: -lto_library ../lib/libLTO.dylib \
+# RUN: -mllvm -time-passes \
+# RUN: -objc_abi_version 2 \
+# RUN: -ios_simulator_version_min 9.0.0 \
+# RUN: -sdk_version 13.2
+# RUN: not %lld -v --not-an-ignored-argument 2>&1 | FileCheck %s
+# CHECK: error: unknown argument '--not-an-ignored-argument'
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
+# RUN: %lld %t.o -o /dev/null -objc_abi_version 2
+
+.globl _main
+_main:
+ ret
Index: lld/MachO/Options.td
===================================================================
--- lld/MachO/Options.td
+++ lld/MachO/Options.td
@@ -1277,10 +1277,6 @@
HelpText<"This option is undocumented in ld64">,
Flags<[HelpHidden]>,
Group<grp_undocumented>;
-def objc_abi_version : Separate<["-"], "objc_abi_version">,
- HelpText<"This option is undocumented in ld64">,
- Flags<[HelpHidden]>,
- Group<grp_undocumented>;
def pause : Flag<["-"], "pause">,
HelpText<"This option is undocumented in ld64">,
Flags<[HelpHidden]>,
@@ -1324,3 +1320,10 @@
HelpText<"This option is ignored in ld64">,
Flags<[HelpHidden]>,
Group<grp_ignored>;
+
+def grp_ignored_silently : OptionGroup<"ignored_silently">, HelpText<"IGNORED SILENTLY">;
+
+def objc_abi_version : Separate<["-"], "objc_abi_version">,
+ HelpText<"This option only applies to i386 in ld64">,
+ Flags<[HelpHidden]>,
+ Group<grp_ignored_silently>;
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -780,6 +780,8 @@
case OPT_grp_ignored:
warn("Option `" + opt.getPrefixedName() + "' is ignored.");
break;
+ case OPT_grp_ignored_silently:
+ break;
default:
warn("Option `" + opt.getPrefixedName() +
"' is not yet implemented. Stay tuned...");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113070.384555.patch
Type: text/x-patch
Size: 2958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/d9efc445/attachment.bin>
More information about the llvm-commits
mailing list