Index: ELF/DriverUtils.cpp =================================================================== --- ELF/DriverUtils.cpp +++ ELF/DriverUtils.cpp @@ -28,6 +28,7 @@ #include "llvm/Support/Process.h" using namespace llvm; +using namespace llvm::opt; using namespace llvm::sys; using namespace lld; @@ -42,9 +43,9 @@ // Create table mapping all options defined in Options.td static const opt::OptTable::Info OptInfo[] = { -#define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, X8, X9, X10, X11, X12) \ - {X1, X2, X10, X11, OPT_##ID, opt::Option::KIND##Class, \ - X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12}, +#define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, FLAGS, X9, X10, X11, X12) \ + {X1, X2, X10, X11, OPT_##ID, opt::Option::KIND##Class, \ + X9, FLAGS, OPT_##GROUP, OPT_##ALIAS, X7, X12}, #include "Options.inc" #undef OPTION }; @@ -116,7 +117,8 @@ void elf::printHelp(const char *Argv0) { ELFOptTable Table; - Table.PrintHelp(outs(), Argv0, "lld", false); + Table.PrintHelp(outs(), Argv0, "lld", false /*ShowHidden*/, + true /*ShowAliases*/); outs() << "\n"; // Scripts generated by Libtool versions up to at least 2.4.6 (the most Index: ELF/Options.td =================================================================== --- ELF/Options.td +++ ELF/Options.td @@ -20,7 +20,7 @@ def build_id: F<"build-id">, HelpText<"Generate build ID note">; -def build_id_eq: J<"build-id=">, HelpText<"Generate build ID note">; +def build_id_eq: J<"build-id=">, HelpText<"Generate build ID note">, Flags<[HelpHidden]>; def compress_debug_sections : J<"compress-debug-sections=">, HelpText<"Compress DWARF debug sections">; @@ -47,7 +47,7 @@ def color_diagnostics: F<"color-diagnostics">, HelpText<"Use colors in diagnostics">; -def color_diagnostics_eq: J<"color-diagnostics=">, +def color_diagnostics_eq: J<"color-diagnostics=">, Flags<[HelpHidden]>, HelpText<"Use colors in diagnostics">; def define_common: F<"define-common">, @@ -295,56 +295,55 @@ def alias_define_common_d: Flag<["-"], "d">, Alias; def alias_define_common_dc: F<"dc">, Alias; def alias_define_common_dp: F<"dp">, Alias; -def alias_defsym: S<"defsym">, Alias; +def alias_defsym: S<"defsym">, Alias, Flags<[HelpHidden]>; def alias_discard_all_x: Flag<["-"], "x">, Alias; def alias_discard_locals_X: Flag<["-"], "X">, Alias; def alias_dynamic_list: J<"dynamic-list=">, Alias; def alias_emit_relocs: Flag<["-"], "q">, Alias; def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias; -def alias_entry_entry: J<"entry=">, Alias; -def alias_error_limit: J<"error-limit=">, Alias; -def alias_exclude_libs: J<"exclude-libs=">, Alias; +def alias_entry_entry: J<"entry=">, Alias, Flags<[HelpHidden]>; +def alias_error_limit: J<"error-limit=">, Alias, Flags<[HelpHidden]>; def alias_export_dynamic_E: Flag<["-"], "E">, Alias; def alias_export_dynamic_symbol: J<"export-dynamic-symbol=">, Alias; def alias_filter: Separate<["-"], "F">, Alias; -def alias_fini_fini: J<"fini=">, Alias; +def alias_fini_fini: J<"fini=">, Alias, Flags<[HelpHidden]>; def alias_format_b: S<"b">, Alias; def alias_hash_style_hash_style: J<"hash-style=">, Alias; -def alias_init_init: J<"init=">, Alias; +def alias_init_init: J<"init=">, Alias, Flags<[HelpHidden]>; def alias_l__library: J<"library=">, Alias; -def alias_Map_eq: J<"Map=">, Alias; +def alias_Map_eq: J<"Map=">, Alias, Flags<[HelpHidden]>; def alias_omagic: Flag<["-"], "N">, Alias; -def alias_o_output: Joined<["--"], "output=">, Alias; +def alias_o_output: Joined<["--"], "output=">, Alias, Flags<[HelpHidden]>; def alias_o_output2 : Separate<["--"], "output">, Alias; def alias_pie_pic_executable: F<"pic-executable">, Alias; def alias_print_map_M: Flag<["-"], "M">, Alias; def alias_relocatable_r: Flag<["-"], "r">, Alias; -def alias_reproduce_eq: J<"reproduce=">, Alias; -def alias_retain_symbols_file: S<"retain-symbols-file">, Alias; +def alias_reproduce_eq: J<"reproduce=">, Alias, Flags<[HelpHidden]>; +def alias_retain_symbols_file: S<"retain-symbols-file">, Alias, Flags<[HelpHidden]>; def alias_rpath_R: JoinedOrSeparate<["-"], "R">, Alias; -def alias_rpath_rpath: J<"rpath=">, Alias; +def alias_rpath_rpath: J<"rpath=">, Alias, Flags<[HelpHidden]>; def alias_script_T: JoinedOrSeparate<["-"], "T">, Alias