LLVM 19.0.0git
Protected Member Functions | List of all members
llvm::opt::GenericOptTable Class Reference

Specialization of OptTable. More...

#include "llvm/Option/OptTable.h"

Inheritance diagram for llvm::opt::GenericOptTable:
Inheritance graph
[legend]

Protected Member Functions

 GenericOptTable (ArrayRef< Info > OptionInfos, bool IgnoreCase=false)
 
ArrayRef< StringLiteralgetPrefixesUnion () const final
 The union of all option prefixes.
 
- Protected Member Functions inherited from llvm::opt::OptTable
virtual ArrayRef< StringLiteralgetPrefixesUnion () const =0
 The union of all option prefixes.
 
 OptTable (ArrayRef< Info > OptionInfos, bool IgnoreCase=false)
 Initialize OptTable using Tablegen'ed OptionInfos.
 
void buildPrefixChars ()
 Build (or rebuild) the PrefixChars member.
 

Additional Inherited Members

- Public Member Functions inherited from llvm::opt::OptTable
virtual ~OptTable ()
 
unsigned getNumOptions () const
 Return the total number of option classes.
 
const Option getOption (OptSpecifier Opt) const
 Get the given Opt's Option instance, lazily creating it if necessary.
 
StringRef getOptionName (OptSpecifier id) const
 Lookup the name of the given option.
 
unsigned getOptionKind (OptSpecifier id) const
 Get the kind of the given option.
 
unsigned getOptionGroupID (OptSpecifier id) const
 Get the group id for the given option.
 
const chargetOptionHelpText (OptSpecifier id) const
 Get the help text to use to describe this option.
 
const chargetOptionMetaVar (OptSpecifier id) const
 Get the meta-variable name to use when describing this options values in the help text.
 
void setInitialOptionsFromEnvironment (const char *E)
 Specify the environment variable where initial options should be read.
 
void setGroupedShortOptions (bool Value)
 Support grouped short options. e.g. -ab represents -a -b.
 
void setDashDashParsing (bool Value)
 Set whether "--" stops option parsing and treats all subsequent arguments as positional.
 
std::vector< std::string > suggestValueCompletions (StringRef Option, StringRef Arg) const
 Find possible value for given flags.
 
std::vector< std::string > findByPrefix (StringRef Cur, Visibility VisibilityMask, unsigned int DisableFlags) const
 Find flags from OptTable which starts with Cur.
 
unsigned findNearest (StringRef Option, std::string &NearestString, Visibility VisibilityMask=Visibility(), unsigned MinimumLength=4, unsigned MaximumDistance=UINT_MAX) const
 Find the OptTable option that most closely matches the given string.
 
unsigned findNearest (StringRef Option, std::string &NearestString, unsigned FlagsToInclude, unsigned FlagsToExclude=0, unsigned MinimumLength=4, unsigned MaximumDistance=UINT_MAX) const
 
bool findExact (StringRef Option, std::string &ExactString, Visibility VisibilityMask=Visibility()) const
 
bool findExact (StringRef Option, std::string &ExactString, unsigned FlagsToInclude, unsigned FlagsToExclude=0) const
 
std::unique_ptr< ArgParseOneArg (const ArgList &Args, unsigned &Index, Visibility VisibilityMask=Visibility()) const
 Parse a single argument; returning the new argument and updating Index.
 
std::unique_ptr< ArgParseOneArg (const ArgList &Args, unsigned &Index, unsigned FlagsToInclude, unsigned FlagsToExclude) const
 
InputArgList ParseArgs (ArrayRef< const char * > Args, unsigned &MissingArgIndex, unsigned &MissingArgCount, Visibility VisibilityMask=Visibility()) const
 Parse an list of arguments into an InputArgList.
 
InputArgList ParseArgs (ArrayRef< const char * > Args, unsigned &MissingArgIndex, unsigned &MissingArgCount, unsigned FlagsToInclude, unsigned FlagsToExclude=0) const
 
InputArgList parseArgs (int Argc, char *const *Argv, OptSpecifier Unknown, StringSaver &Saver, std::function< void(StringRef)> ErrorFn) const
 A convenience helper which handles optional initial options populated from an environment variable, expands response files recursively and parses options.
 
void printHelp (raw_ostream &OS, const char *Usage, const char *Title, bool ShowHidden=false, bool ShowAllAliases=false, Visibility VisibilityMask=Visibility()) const
 Render the help text for an option table.
 
void printHelp (raw_ostream &OS, const char *Usage, const char *Title, unsigned FlagsToInclude, unsigned FlagsToExclude, bool ShowAllAliases) const
 
- Protected Attributes inherited from llvm::opt::OptTable
unsigned FirstSearchableIndex = 0
 The index of the first option which can be parsed (i.e., is not a special option like 'input' or 'unknown', and is not an option group).
 
SmallString< 8 > PrefixChars
 The union of the first element of all option prefixes.
 

Detailed Description

Specialization of OptTable.

Definition at line 330 of file OptTable.h.

Constructor & Destructor Documentation

◆ GenericOptTable()

GenericOptTable::GenericOptTable ( ArrayRef< Info OptionInfos,
bool  IgnoreCase = false 
)
protected

Member Function Documentation

◆ getPrefixesUnion()

ArrayRef< StringLiteral > llvm::opt::GenericOptTable::getPrefixesUnion ( ) const
inlinefinalprotectedvirtual

The union of all option prefixes.

If an argument does not begin with one of these, it is an input.

Implements llvm::opt::OptTable.

Definition at line 335 of file OptTable.h.


The documentation for this class was generated from the following files: