Index: include/clang/Driver/Driver.h =================================================================== --- include/clang/Driver/Driver.h +++ include/clang/Driver/Driver.h @@ -316,7 +316,8 @@ /// PrintHelp - Print the help text. /// /// \param ShowHidden - Show hidden options. - void PrintHelp(bool ShowHidden) const; + /// \param ShowHidden - Show hidden options without help string, too. + void PrintHelp(bool ShowHidden, bool ShowUndocumented) const; /// PrintVersion - Print the driver version. void PrintVersion(const Compilation &C, raw_ostream &OS) const; Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1590,6 +1590,7 @@ def _force_link_EQ : Joined<["--"], "force-link=">, Alias; def _force_link : Separate<["--"], "force-link">, Alias; def _help_hidden : Flag<["--"], "help-hidden">; +def _help_hidden_all : Flag<["--"], "help-hidden-all">; def _imacros_EQ : Joined<["--"], "imacros=">, Alias; def _include_barrier : Flag<["--"], "include-barrier">, Alias; def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias; Index: lib/Driver/Driver.cpp =================================================================== --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -643,7 +643,7 @@ return 0; } -void Driver::PrintHelp(bool ShowHidden) const { +void Driver::PrintHelp(bool ShowHidden, bool ShowUndocumented) const { unsigned IncludedFlagsBitmask; unsigned ExcludedFlagsBitmask; std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) = @@ -654,7 +654,8 @@ ExcludedFlagsBitmask |= HelpHidden; getOpts().PrintHelp(llvm::outs(), Name.c_str(), DriverTitle.c_str(), - IncludedFlagsBitmask, ExcludedFlagsBitmask); + IncludedFlagsBitmask, ExcludedFlagsBitmask, + ShowUndocumented); } void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { @@ -709,8 +710,11 @@ } if (C.getArgs().hasArg(options::OPT_help) || - C.getArgs().hasArg(options::OPT__help_hidden)) { - PrintHelp(C.getArgs().hasArg(options::OPT__help_hidden)); + C.getArgs().hasArg(options::OPT__help_hidden) || + C.getArgs().hasArg(options::OPT__help_hidden_all)) { + PrintHelp(C.getArgs().hasArg(options::OPT__help_hidden) || + C.getArgs().hasArg(options::OPT__help_hidden_all), + C.getArgs().hasArg(options::OPT__help_hidden_all)); return false; }