diff options
author | Greg McGary <gkm@fb.com> | 2020-09-23 08:53:37 -0700 |
---|---|---|
committer | Greg McGary <gkm@fb.com> | 2020-09-23 14:38:23 -0700 |
commit | fa5f9452120cc1691d23e272697695a5a4331f9c (patch) | |
tree | e0c948f7a6bf7957f6c483af312ebc3007097409 /lld | |
parent | 140b7b6f09ca01f89701ccc86ddd8553cf42c311 (diff) | |
download | llvm-fa5f9452120cc1691d23e272697695a5a4331f9c.zip llvm-fa5f9452120cc1691d23e272697695a5a4331f9c.tar.gz llvm-fa5f9452120cc1691d23e272697695a5a4331f9c.tar.bz2 |
[lld-macho] cleanup unimplemented-option warnings
Remove all spurious `HelpHidden` flags from `lld/MachO/Options.td`. Add test for `HelpHidden` to `warnIfUnimplementedOption()` so that the empty `// handled elsewhere` case is unnecessary.
Reviewed By: #lld-macho, int3, smeenai
Differential Revision: https://reviews.llvm.org/D88160
Diffstat (limited to 'lld')
-rw-r--r-- | lld/MachO/Driver.cpp | 24 | ||||
-rw-r--r-- | lld/MachO/Options.td | 11 |
2 files changed, 3 insertions, 32 deletions
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp index 7d83ec3..c098e7e 100644 --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -469,7 +469,7 @@ static void warnIfDeprecatedOption(const opt::Option &opt) { } static void warnIfUnimplementedOption(const opt::Option &opt) { - if (!opt.getGroup().isValid()) + if (!opt.getGroup().isValid() || !opt.hasFlag(DriverFlag::HelpHidden)) return; switch (opt.getGroup().getID()) { case OPT_grp_deprecated: @@ -562,6 +562,8 @@ bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly, for (const auto &arg : args) { const auto &opt = arg->getOption(); warnIfDeprecatedOption(opt); + warnIfUnimplementedOption(opt); + // TODO: are any of these better handled via filtered() or getLastArg()? switch (arg->getOption().getID()) { case OPT_INPUT: addFile(arg->getValue()); @@ -593,27 +595,7 @@ bool macho::link(llvm::ArrayRef<const char *> argsArr, bool canExitEarly, case OPT_platform_version: handlePlatformVersion(arg); break; - case OPT_all_load: - case OPT_o: - case OPT_dylib: - case OPT_e: - case OPT_F: - case OPT_L: - case OPT_ObjC: - case OPT_headerpad: - case OPT_headerpad_max_install_names: - case OPT_install_name: - case OPT_rpath: - case OPT_sub_library: - case OPT_Z: - case OPT_arch: - case OPT_syslibroot: - case OPT_sectcreate: - case OPT_dynamic: - // handled elsewhere - break; default: - warnIfUnimplementedOption(opt); break; } } diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td index e7dc0e7c8..602f723 100644 --- a/lld/MachO/Options.td +++ b/lld/MachO/Options.td @@ -101,7 +101,6 @@ def Z : Flag<["-"], "Z">, def syslibroot : Separate<["-"], "syslibroot">, MetaVarName<"<rootdir>">, HelpText<"Prepend <rootdir> to all library and framework search paths">, - Flags<[HelpHidden]>, Group<grp_libs>; def search_paths_first : Flag<["-"], "search_paths_first">, HelpText<"Search for lib<name>.dylib and lib<name>.a at each step in traversing search path (default for Xcode 4 and later)">, @@ -114,7 +113,6 @@ def search_dylibs_first : Flag<["-"], "search_dylibs_first">, def framework : Separate<["-"], "framework">, MetaVarName<"<name>">, HelpText<"Search for <name>.framework/<name> on the framework search path">, - Flags<[HelpHidden]>, Group<grp_libs>; def weak_framework : Separate<["-"], "weak_framework">, MetaVarName<"<name>">, @@ -134,20 +132,16 @@ def upward_framework : Separate<["-"], "upward_framework">, def F : JoinedOrSeparate<["-"], "F">, MetaVarName<"<dir>">, HelpText<"Add dir to the framework search path">, - Flags<[HelpHidden]>, Group<grp_libs>; def all_load : Flag<["-"], "all_load">, HelpText<"Load all members of all static archive libraries">, - Flags<[HelpHidden]>, Group<grp_libs>; def ObjC : Flag<["-"], "ObjC">, HelpText<"Load all members of static archives that are an Objective-C class or category.">, - Flags<[HelpHidden]>, Group<grp_libs>; def force_load : Separate<["-"], "force_load">, MetaVarName<"<path>">, HelpText<"Load all members static archive library at <path>">, - Flags<[HelpHidden]>, Group<grp_libs>; def grp_content : OptionGroup<"content">, HelpText<"ADDITIONAL CONTENT">; @@ -165,7 +159,6 @@ def segcreate : MultiArg<["-"], "segcreate", 3>, def filelist : Separate<["-"], "filelist">, MetaVarName<"<file>">, HelpText<"Read names of files to link from <file>">, - Flags<[HelpHidden]>, Group<grp_content>; def dtrace : Separate<["-"], "dtrace">, MetaVarName<"<script>">, @@ -182,7 +175,6 @@ def dead_strip : Flag<["-"], "dead_strip">, def order_file : Separate<["-"], "order_file">, MetaVarName<"<file>">, HelpText<"Layout functions and data according to specification in <file>">, - Flags<[HelpHidden]>, Group<grp_opts>; def sectorder : MultiArg<["-"], "sectorder", 3>, MetaVarName<"<segname> <sectname> <orderfile>">, @@ -200,7 +192,6 @@ def no_order_data : Flag<["-"], "no_order_data">, def platform_version : MultiArg<["-"], "platform_version", 3>, MetaVarName<"<platform> <min_version> <sdk_version>">, HelpText<"Platform (e.g., macos, ios, tvos, watchos, bridgeos, mac-catalyst, ios-sim, tvos-sim, watchos-sim, driverkit) and version numbers">, - Flags<[HelpHidden]>, Group<grp_opts>; def macos_version_min : Separate<["-"], "macos_version_min">, MetaVarName<"<version>">, @@ -505,7 +496,6 @@ def grp_rare : OptionGroup<"rare">, HelpText<"RARELY USED">; def v : Flag<["-"], "v">, HelpText<"Print the linker version">, - Flags<[HelpHidden]>, Group<grp_rare>; def version_details : Flag<["-"], "version_details">, HelpText<"Print the linker version in JSON form">, @@ -665,7 +655,6 @@ def init : Separate<["-"], "init">, def sub_library : Separate<["-"], "sub_library">, MetaVarName<"<name>">, HelpText<"Re-export the dylib as <name>">, - Flags<[HelpHidden]>, Group<grp_rare>; def sub_umbrella : Separate<["-"], "sub_umbrella">, MetaVarName<"<name>">, |