From 044eb2f6afba375a914ac9d8024f8f5142bb912e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:10:56 +0000 Subject: Vendor import of llvm trunk r321017: https://llvm.org/svn/llvm-project/llvm/trunk@321017 --- include/llvm/Option/OptTable.h | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'include/llvm/Option/OptTable.h') diff --git a/include/llvm/Option/OptTable.h b/include/llvm/Option/OptTable.h index a35e182f00e5..57a6954f4878 100644 --- a/include/llvm/Option/OptTable.h +++ b/include/llvm/Option/OptTable.h @@ -57,8 +57,8 @@ public: }; private: - /// \brief The static option information table. - ArrayRef OptionInfos; + /// \brief The option information table. + std::vector OptionInfos; bool IgnoreCase; unsigned TheInputOptionID = 0; @@ -143,6 +143,17 @@ public: std::vector findByPrefix(StringRef Cur, unsigned short DisableFlags) const; + /// Add Values to Option's Values class + /// + /// \param [in] Option - Prefix + Name of the flag which Values will be + /// changed. For example, "-analyzer-checker". + /// \param [in] Values - String of Values seperated by ",", such as + /// "foo, bar..", where foo and bar is the argument which the Option flag + /// takes + /// + /// \return true in success, and false in fail. + bool addValues(const char *Option, const char *Values); + /// \brief Parse a single argument; returning the new argument and /// updating Index. /// @@ -191,12 +202,16 @@ public: /// \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, unsigned FlagsToInclude, - unsigned FlagsToExclude) const; - - void PrintHelp(raw_ostream &OS, const char *Name, - const char *Title, bool ShowHidden = false) const; + /// \param ShowAllAliases - If true, display all options including aliases + /// that don't have help texts. By default, we display + /// only options that are not hidden and have help + /// texts. + void PrintHelp(raw_ostream &OS, const char *Name, const char *Title, + unsigned FlagsToInclude, unsigned FlagsToExclude, + bool ShowAllAliases) const; + + void PrintHelp(raw_ostream &OS, const char *Name, const char *Title, + bool ShowHidden = false, bool ShowAllAliases = false) const; }; } // end namespace opt -- cgit v1.2.3