class Option
Declaration
class Option { /* full declaration omitted */ };
Description
Option - Abstract representation for a single form of driver argument. An Option class represents a form of option that the driver takes, for example how many arguments the option has and how they can be provided. Individual option instances store additional information about what group the option is a member of (if any), if the option is an alias, and a number of flags. At runtime the driver parses the command line into concrete Arg instances, each of which corresponds to a particular Option instance.
Declared at: llvm/include/llvm/Option/Option.h:51
Member Variables
- protected const OptTable::Info* Info
- protected const llvm::opt::OptTable* Owner
Method Overview
- public Option(const OptTable::Info * Info, const llvm::opt::OptTable * Owner)
- public llvm::opt::Arg * accept(const llvm::opt::ArgList & Args, unsigned int & Index, unsigned int ArgSize) const
- public void dump() const
- public const llvm::opt::Option getAlias() const
- public const char * getAliasArgs() const
- public const llvm::opt::Option getGroup() const
- public unsigned int getID() const
- public llvm::opt::Option::OptionClass getKind() const
- public llvm::StringRef getName() const
- public unsigned int getNumArgs() const
- public llvm::StringRef getPrefix() const
- public std::string getPrefixedName() const
- public llvm::StringRef getRenderName() const
- public llvm::opt::Option::RenderStyleKind getRenderStyle() const
- public const llvm::opt::Option getUnaliasedOption() const
- public bool hasFlag(unsigned int Val) const
- public bool hasNoOptAsInput() const
- public bool isValid() const
- public bool matches(llvm::opt::OptSpecifier ID) const
- public void print(llvm::raw_ostream & O) const
Methods
¶Option(const OptTable::Info* Info,
const llvm::opt::OptTable* Owner)
Option(const OptTable::Info* Info,
const llvm::opt::OptTable* Owner)
Declared at: llvm/include/llvm/Option/Option.h:81
Parameters
- const OptTable::Info* Info
- const llvm::opt::OptTable* Owner
¶llvm::opt::Arg* accept(
const llvm::opt::ArgList& Args,
unsigned int& Index,
unsigned int ArgSize) const
llvm::opt::Arg* accept(
const llvm::opt::ArgList& Args,
unsigned int& Index,
unsigned int ArgSize) const
Description
accept - Potentially accept the current argument, returning a new Arg instance, or 0 if the option does not accept this argument (or the argument is missing values). If the option accepts the current argument, accept() sets Index to the position where argument parsing should resume (even if the argument is missing values).
Declared at: llvm/include/llvm/Option/Option.h:207
Parameters
- const llvm::opt::ArgList& Args
- unsigned int& Index
- unsigned int ArgSize
- The number of bytes taken up by the matched Option prefix and name. This is used to determine where joined values start.
¶void dump() const
void dump() const
Declared at: llvm/include/llvm/Option/Option.h:215
¶const llvm::opt::Option getAlias() const
const llvm::opt::Option getAlias() const
Declared at: llvm/include/llvm/Option/Option.h:109
¶const char* getAliasArgs() const
const char* getAliasArgs() const
Description
Get the alias arguments as a \ 0 separated list. E.g. ["foo", "bar"] would be returned as "foo\0bar\0".
Declared at: llvm/include/llvm/Option/Option.h:117
¶const llvm::opt::Option getGroup() const
const llvm::opt::Option getGroup() const
Declared at: llvm/include/llvm/Option/Option.h:103
¶unsigned int getID() const
unsigned int getID() const
Declared at: llvm/include/llvm/Option/Option.h:87
¶llvm::opt::Option::OptionClass getKind() const
llvm::opt::Option::OptionClass getKind() const
Declared at: llvm/include/llvm/Option/Option.h:92
¶llvm::StringRef getName() const
llvm::StringRef getName() const
Description
Get the name of this option without any prefix.
Declared at: llvm/include/llvm/Option/Option.h:98
¶unsigned int getNumArgs() const
unsigned int getNumArgs() const
Declared at: llvm/include/llvm/Option/Option.h:138
¶llvm::StringRef getPrefix() const
llvm::StringRef getPrefix() const
Description
Get the default prefix for this option.
Declared at: llvm/include/llvm/Option/Option.h:126
¶std::string getPrefixedName() const
std::string getPrefixedName() const
Description
Get the name of this option with the default prefix.
Declared at: llvm/include/llvm/Option/Option.h:132
¶llvm::StringRef getRenderName() const
llvm::StringRef getRenderName() const
Description
getRenderName - Return the name to use when rendering this option.
Declared at: llvm/include/llvm/Option/Option.h:184
¶llvm::opt::Option::RenderStyleKind
getRenderStyle() const
llvm::opt::Option::RenderStyleKind
getRenderStyle() const
Declared at: llvm/include/llvm/Option/Option.h:142
¶const llvm::opt::Option getUnaliasedOption() const
const llvm::opt::Option getUnaliasedOption() const
Description
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias).
Declared at: llvm/include/llvm/Option/Option.h:176
¶bool hasFlag(unsigned int Val) const
bool hasFlag(unsigned int Val) const
Description
Test if this option has the flag \a Val.
Declared at: llvm/include/llvm/Option/Option.h:170
Parameters
- unsigned int Val
¶bool hasNoOptAsInput() const
bool hasNoOptAsInput() const
Declared at: llvm/include/llvm/Option/Option.h:140
¶bool isValid() const
bool isValid() const
Declared at: llvm/include/llvm/Option/Option.h:83
¶bool matches(llvm::opt::OptSpecifier ID) const
bool matches(llvm::opt::OptSpecifier ID) const
Description
matches - Predicate for whether this option is part of the given option (which may be a group). Note that matches against options which are an alias should never be done -- aliases do not participate in matching and so such a query will always be false.
Declared at: llvm/include/llvm/Option/Option.h:194
Parameters
¶void print(llvm::raw_ostream& O) const
void print(llvm::raw_ostream& O) const
Declared at: llvm/include/llvm/Option/Option.h:214