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
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index 0c54ecc..61c3d49 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option] in {
+let Flags = [CC1Option, NoDriverOption] in {
//===----------------------------------------------------------------------===//
// Target Options
diff --git a/include/clang/Driver/OptParser.td b/include/clang/Driver/OptParser.td
index 9a3eb09..d16a2a7 100644
--- a/include/clang/Driver/OptParser.td
+++ b/include/clang/Driver/OptParser.td
@@ -88,6 +88,9 @@
// CC1Option - This option should be accepted by clang -cc1.
def CC1Option : OptionFlag;
+// NoDriverOption - This option should not be accepted by the driver.
+def NoDriverOption : OptionFlag;
+
// Define the option group class.
class OptionGroup<string name> {
diff --git a/include/clang/Driver/OptTable.h b/include/clang/Driver/OptTable.h
index 63bec30..53d83a0 100644
--- a/include/clang/Driver/OptTable.h
+++ b/include/clang/Driver/OptTable.h
@@ -99,9 +99,6 @@
return getInfo(id).GroupID;
}
- /// \brief Should the help for the given option be hidden by default.
- bool isOptionHelpHidden(OptSpecifier id) const;
-
/// \brief Get the help text to use to describe this option.
const char *getOptionHelpText(OptSpecifier id) const {
return getInfo(id).HelpText;
@@ -151,9 +148,12 @@
/// \param OS - The stream to write the help text to.
/// \param Name - The name to use in the usage line.
/// \param Title - The title to use in the usage line.
- /// \param ShowHidden - Whether help-hidden arguments should be shown.
+ /// \param FlagsToInclude - If non-zero, only include options with any
+ /// of these flags set.
+ /// \param FlagsToExclude - Exclude options with any of these flags set.
void PrintHelp(raw_ostream &OS, const char *Name,
- const char *Title, bool ShowHidden = false) const;
+ const char *Title, unsigned short FlagsToInclude = 0,
+ unsigned short FlagsToExclude = 0) const;
};
}
}
diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h
index c96ec68..c3db773 100644
--- a/include/clang/Driver/Option.h
+++ b/include/clang/Driver/Option.h
@@ -36,7 +36,8 @@
NoArgumentUnused = (1 << 6),
NoForward = (1 << 7),
Unsupported = (1 << 8),
- CC1Option = (1 << 9)
+ CC1Option = (1 << 9),
+ NoDriverOption = (1 << 10)
};
}