diff options
Diffstat (limited to 'include/clang/Driver/OptTable.h')
-rw-r--r-- | include/clang/Driver/OptTable.h | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/include/clang/Driver/OptTable.h b/include/clang/Driver/OptTable.h index faaeba6..edae75c 100644 --- a/include/clang/Driver/OptTable.h +++ b/include/clang/Driver/OptTable.h @@ -13,17 +13,22 @@ #include "clang/Driver/OptSpecifier.h" #include <cassert> +namespace llvm { + class raw_ostream; +} + namespace clang { namespace driver { namespace options { enum DriverFlag { DriverOption = (1 << 0), - LinkerInput = (1 << 1), - NoArgumentUnused = (1 << 2), - RenderAsInput = (1 << 3), - RenderJoined = (1 << 4), - RenderSeparate = (1 << 5), - Unsupported = (1 << 6) + HelpHidden = (1 << 1), + LinkerInput = (1 << 2), + NoArgumentUnused = (1 << 3), + RenderAsInput = (1 << 4), + RenderJoined = (1 << 5), + RenderSeparate = (1 << 6), + Unsupported = (1 << 7) }; } @@ -113,6 +118,17 @@ namespace options { return getInfo(id).Kind; } + /// getOptionGroupID - Get the group id for the given option. + unsigned getOptionGroupID(OptSpecifier id) const { + return getInfo(id).GroupID; + } + + /// isOptionHelpHidden - Should the help for the given option be hidden by + /// default. + bool isOptionHelpHidden(OptSpecifier id) const { + return getInfo(id).Flags & options::HelpHidden; + } + /// getOptionHelpText - Get the help text to use to describe this option. const char *getOptionHelpText(OptSpecifier id) const { return getInfo(id).HelpText; @@ -156,6 +172,15 @@ namespace options { const char **ArgEnd, unsigned &MissingArgIndex, unsigned &MissingArgCount) const; + + /// PrintHelp - Render the help text for an option table. + /// + /// \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. + void PrintHelp(llvm::raw_ostream &OS, const char *Name, + const char *Title, bool ShowHidden = false) const; }; } } |