diff options
Diffstat (limited to 'lib/Driver')
-rw-r--r-- | lib/Driver/Driver.cpp | 4 | ||||
-rw-r--r-- | lib/Driver/OptTable.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 7d63bf4ae6..464df333f7 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -564,7 +564,9 @@ void Driver::PrintOptions(const ArgList &Args) const { void Driver::PrintHelp(bool ShowHidden) const { getOpts().PrintHelp(llvm::outs(), Name.c_str(), DriverTitle.c_str(), - ShowHidden); + /*Include*/0, + /*Exclude*/options::NoDriverOption | + (ShowHidden ? 0 : options::HelpHidden)); } void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp index db59298743..6e7b6951fb 100644 --- a/lib/Driver/OptTable.cpp +++ b/lib/Driver/OptTable.cpp @@ -163,10 +163,6 @@ const Option OptTable::getOption(OptSpecifier Opt) const { return Option(&getInfo(id), this); } -bool OptTable::isOptionHelpHidden(OptSpecifier id) const { - return getInfo(id).Flags & options::HelpHidden; -} - static bool isInput(const llvm::StringSet<> &Prefixes, StringRef Arg) { if (Arg == "-") return true; @@ -350,7 +346,8 @@ static const char *getOptionHelpGroup(const OptTable &Opts, OptSpecifier Id) { } void OptTable::PrintHelp(raw_ostream &OS, const char *Name, - const char *Title, bool ShowHidden) const { + const char *Title, unsigned short FlagsToInclude, + unsigned short FlagsToExclude) const { OS << "OVERVIEW: " << Title << "\n"; OS << '\n'; OS << "USAGE: " << Name << " [options] <inputs>\n"; @@ -369,7 +366,8 @@ void OptTable::PrintHelp(raw_ostream &OS, const char *Name, if (getOptionKind(Id) == Option::GroupClass) continue; - if (!ShowHidden && isOptionHelpHidden(Id)) + if ((FlagsToInclude && !(getInfo(Id).Flags & FlagsToInclude)) || + getInfo(Id).Flags & FlagsToExclude) continue; if (const char *Text = getOptionHelpText(Id)) { |