clang API Documentation
#include <OptTable.h>
Classes | |
| struct | Info |
| Info - Entry for a single option instance in the option data table. More... | |
Public Member Functions | |
| ~OptTable () | |
| unsigned | getNumOptions () const |
| getNumOptions - Return the total number of option classes. | |
| const Option * | getOption (OptSpecifier Opt) const |
| const char * | getOptionName (OptSpecifier id) const |
| getOptionName - Lookup the name of the given option. | |
| unsigned | getOptionKind (OptSpecifier id) const |
| getOptionKind - Get the kind of the given option. | |
| unsigned | getOptionGroupID (OptSpecifier id) const |
| getOptionGroupID - Get the group id for the given option. | |
| bool | isOptionHelpHidden (OptSpecifier id) const |
| const char * | getOptionHelpText (OptSpecifier id) const |
| getOptionHelpText - Get the help text to use to describe this option. | |
| const char * | getOptionMetaVar (OptSpecifier id) const |
| Arg * | ParseOneArg (const ArgList &Args, unsigned &Index) const |
| InputArgList * | ParseArgs (const char *const *ArgBegin, const char *const *ArgEnd, unsigned &MissingArgIndex, unsigned &MissingArgCount) const |
| void | PrintHelp (raw_ostream &OS, const char *Name, const char *Title, bool ShowHidden=false) const |
Protected Member Functions | |
| OptTable (const Info *_OptionInfos, unsigned _NumOptionInfos) | |
OptTable - Provide access to the Option info table.
The OptTable class provides a layer of indirection which allows Option instance to be created lazily. In the common case, only a few options will be needed at runtime; the OptTable class maintains enough information to parse command lines without instantiating Options, while letting other parts of the driver still use Option instances where convenient.
Definition at line 44 of file OptTable.h.
| OptTable::OptTable | ( | const Info * | _OptionInfos, |
| unsigned | _NumOptionInfos | ||
| ) | [protected] |
Definition at line 80 of file OptTable.cpp.
References clang::driver::Option::dump(), getNumOptions(), getOption(), clang::driver::Option::GroupClass, clang::driver::Option::InputClass, clang::driver::OptTable::Info::Kind, and clang::driver::Option::UnknownClass.
| OptTable::~OptTable | ( | ) |
Definition at line 126 of file OptTable.cpp.
References getNumOptions().
| unsigned clang::driver::OptTable::getNumOptions | ( | ) | const [inline] |
getNumOptions - Return the total number of option classes.
Definition at line 91 of file OptTable.h.
Referenced by OptTable(), ParseOneArg(), PrintHelp(), and ~OptTable().
| const Option* clang::driver::OptTable::getOption | ( | OptSpecifier | Opt | ) | const [inline] |
getOption - Get the given
Definition at line 97 of file OptTable.h.
References clang::driver::OptSpecifier::getID().
Referenced by OptTable(), and ParseOneArg().
| unsigned clang::driver::OptTable::getOptionGroupID | ( | OptSpecifier | id | ) | const [inline] |
getOptionGroupID - Get the group id for the given option.
Definition at line 120 of file OptTable.h.
References getInfo().
Referenced by getOptionHelpGroup().
| const char* clang::driver::OptTable::getOptionHelpText | ( | OptSpecifier | id | ) | const [inline] |
getOptionHelpText - Get the help text to use to describe this option.
Definition at line 131 of file OptTable.h.
References getInfo().
Referenced by getOptionHelpGroup(), and PrintHelp().
| unsigned clang::driver::OptTable::getOptionKind | ( | OptSpecifier | id | ) | const [inline] |
getOptionKind - Get the kind of the given option.
Definition at line 115 of file OptTable.h.
References getInfo().
Referenced by getOptionHelpName(), and PrintHelp().
| const char* clang::driver::OptTable::getOptionMetaVar | ( | OptSpecifier | id | ) | const [inline] |
getOptionMetaVar - Get the meta-variable name to use when describing this options values in the help text.
Definition at line 137 of file OptTable.h.
References getInfo().
Referenced by getOptionHelpName().
| const char* clang::driver::OptTable::getOptionName | ( | OptSpecifier | id | ) | const [inline] |
getOptionName - Lookup the name of the given option.
Definition at line 110 of file OptTable.h.
References getInfo(), and TypeInfo::Name.
Referenced by getOptionHelpName().
| bool clang::driver::OptTable::isOptionHelpHidden | ( | OptSpecifier | id | ) | const [inline] |
isOptionHelpHidden - Should the help for the given option be hidden by default.
Definition at line 126 of file OptTable.h.
References TypeInfo::Flags, getInfo(), and clang::driver::options::HelpHidden.
Referenced by PrintHelp().
| InputArgList * OptTable::ParseArgs | ( | const char *const * | ArgBegin, |
| const char *const * | ArgEnd, | ||
| unsigned & | MissingArgIndex, | ||
| unsigned & | MissingArgCount | ||
| ) | const |
ParseArgs - Parse an list of arguments into an InputArgList.
The resulting InputArgList will reference the strings in [ArgBegin, ArgEnd), and their lifetime should extend past that of the returned InputArgList.
The only error that can occur in this routine is if an argument is missing values; in this case
| ArgBegin | - The beginning of the argument vector. |
| ArgEnd | - The end of the argument vector. |
| MissingArgIndex | - On error, the index of the option which could not be parsed. |
| MissingArgCount | - On error, the number of missing options. |
Definition at line 230 of file OptTable.cpp.
References clang::driver::ArgList::append(), Args, clang::driver::InputArgList::getArgString(), Index, and ParseOneArg().
Referenced by clang::driver::Driver::ParseArgStrings().
ParseOneArg - Parse a single argument; returning the new argument and updating Index.
| [in] | [out] | Index - The current parsing position in the argument string list; on return this will be the index of the next argument string to parse. |
Definition at line 188 of file OptTable.cpp.
References Arg, clang::driver::ArgList::getArgString(), getNumOptions(), getOption(), Index, and clang::driver::OptTable::Info::Name.
Referenced by clang::driver::Driver::BuildInputs(), and ParseArgs().
| void OptTable::PrintHelp | ( | raw_ostream & | OS, |
| const char * | Name, | ||
| const char * | Title, | ||
| bool | ShowHidden = false |
||
| ) | const |
PrintHelp - Render the help text for an option table.
| OS | - The stream to write the help text to. |
| Name | - The name to use in the usage line. |
| Title | - The title to use in the usage line. |
| ShowHidden | - Whether help-hidden arguments should be shown. |
Definition at line 346 of file OptTable.cpp.
References getNumOptions(), getOptionHelpGroup(), getOptionHelpName(), getOptionHelpText(), getOptionKind(), clang::driver::Option::GroupClass, isOptionHelpHidden(), and PrintHelpOptionList().
Referenced by clang::driver::Driver::PrintHelp().