diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-09 22:36:44 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-09 22:36:44 +0000 |
commit | f1eaab122932a5c61b13ce9ae6d590e24558eb84 (patch) | |
tree | 76b76dd5e34e68da9376188bfd56d9a95742b39b /lib/Driver/OptTable.cpp | |
parent | b328ee55d86acaafd55ebf0e0c84766b29459530 (diff) | |
download | clang-f1eaab122932a5c61b13ce9ae6d590e24558eb84.tar.gz clang-f1eaab122932a5c61b13ce9ae6d590e24558eb84.tar.bz2 clang-f1eaab122932a5c61b13ce9ae6d590e24558eb84.tar.xz |
PR14303: Add a NoDriverOption flag to those options which are not accepted by
the driver (the options defined in CC1Options.td) and exclude their help from
"clang --help".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/OptTable.cpp')
-rw-r--r-- | lib/Driver/OptTable.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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)) { |