LLVM API Documentation
#include <Option.h>
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.
Option::Option | ( | const OptTable::Info * | Info, |
const OptTable * | Owner | ||
) |
Definition at line 22 of file Option.cpp.
References FlagClass, getAlias(), getAliasArgs(), getKind(), Info, and isValid().
Option::~Option | ( | ) |
Definition at line 38 of file Option.cpp.
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).
ArgSize | The number of bytes taken up by the matched Option prefix and name. This is used to determine where joined values start. |
Definition at line 103 of file Option.cpp.
References llvm::ARM_PROC::A, CommaJoinedClass, FlagClass, getAliasArgs(), llvm::opt::ArgList::getArgString(), getID(), getKind(), getName(), getNumArgs(), llvm::opt::ArgList::getNumInputArgStrings(), getPrefix(), getUnaliasedOption(), llvm::opt::Arg::getValues(), JoinedAndSeparateClass, JoinedClass, JoinedOrSeparateClass, llvm_unreachable, llvm::opt::ArgList::MakeArgString(), llvm::LibFunc::memcpy, MultiArgClass, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), RemainingArgsClass, SeparateClass, llvm::opt::Arg::setOwnsValues(), and llvm::LibFunc::strlen.
Referenced by llvm::opt::OptTable::ParseOneArg().
void Option::dump | ( | ) | const |
Definition at line 41 of file Option.cpp.
References CommaJoinedClass, dump(), llvm::errs(), FlagClass, getAlias(), getGroup(), getKind(), getName(), getNumArgs(), GroupClass, Info, InputClass, isValid(), JoinedAndSeparateClass, JoinedClass, JoinedOrSeparateClass, MultiArgClass, P, llvm::opt::OptTable::Info::Prefixes, RemainingArgsClass, SeparateClass, and UnknownClass.
Referenced by llvm::opt::Arg::dump(), dump(), and llvm::opt::OptTable::OptTable().
const Option llvm::opt::Option::getAlias | ( | ) | const [inline] |
Definition at line 101 of file Option.h.
References llvm::opt::OptTable::Info::AliasID, llvm::opt::OptTable::getOption(), Info, and Owner.
Referenced by dump(), getUnaliasedOption(), matches(), and Option().
const char* llvm::opt::Option::getAliasArgs | ( | ) | const [inline] |
const Option llvm::opt::Option::getGroup | ( | ) | const [inline] |
Definition at line 95 of file Option.h.
References llvm::opt::OptTable::getOption(), llvm::opt::OptTable::Info::GroupID, Info, and Owner.
unsigned llvm::opt::Option::getID | ( | ) | const [inline] |
OptionClass llvm::opt::Option::getKind | ( | ) | const [inline] |
Definition at line 84 of file Option.h.
References Info, and llvm::opt::OptTable::Info::Kind.
Referenced by accept(), dump(), getOptionHelpName(), getRenderStyle(), and Option().
StringRef llvm::opt::Option::getName | ( | ) | const [inline] |
Get the name of this option without any prefix.
Definition at line 90 of file Option.h.
References Info, and llvm::opt::OptTable::Info::Name.
Referenced by accept(), dump(), getPrefixedName(), getRenderName(), llvm::opt::DerivedArgList::MakeFlagArg(), llvm::opt::DerivedArgList::MakeJoinedArg(), llvm::opt::DerivedArgList::MakePositionalArg(), and llvm::opt::DerivedArgList::MakeSeparateArg().
unsigned llvm::opt::Option::getNumArgs | ( | ) | const [inline] |
Definition at line 130 of file Option.h.
References Info, and llvm::opt::OptTable::Info::Param.
Referenced by accept(), dump(), and getOptionHelpName().
StringRef llvm::opt::Option::getPrefix | ( | ) | const [inline] |
Get the default prefix for this option.
Definition at line 118 of file Option.h.
References Info, llvm::cl::Prefix, and llvm::opt::OptTable::Info::Prefixes.
Referenced by accept(), getPrefixedName(), llvm::opt::DerivedArgList::MakeFlagArg(), llvm::opt::DerivedArgList::MakeJoinedArg(), llvm::opt::DerivedArgList::MakePositionalArg(), and llvm::opt::DerivedArgList::MakeSeparateArg().
std::string llvm::opt::Option::getPrefixedName | ( | ) | const [inline] |
Get the name of this option with the default prefix.
Definition at line 124 of file Option.h.
References getName(), getPrefix(), and llvm::MipsISD::Ret.
Referenced by getOptionHelpName().
StringRef llvm::opt::Option::getRenderName | ( | ) | const [inline] |
getRenderName - Return the name to use when rendering this option.
Definition at line 174 of file Option.h.
References getName(), and getUnaliasedOption().
RenderStyleKind llvm::opt::Option::getRenderStyle | ( | ) | const [inline] |
Definition at line 134 of file Option.h.
References CommaJoinedClass, FlagClass, llvm::opt::OptTable::Info::Flags, getKind(), GroupClass, Info, InputClass, JoinedAndSeparateClass, JoinedClass, JoinedOrSeparateClass, llvm_unreachable, MultiArgClass, RemainingArgsClass, RenderCommaJoinedStyle, llvm::opt::RenderJoined, RenderJoinedStyle, llvm::opt::RenderSeparate, RenderSeparateStyle, RenderValuesStyle, SeparateClass, and UnknownClass.
const Option llvm::opt::Option::getUnaliasedOption | ( | ) | const [inline] |
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias).
Definition at line 166 of file Option.h.
References getAlias(), getUnaliasedOption(), and isValid().
Referenced by accept(), getRenderName(), and getUnaliasedOption().
bool llvm::opt::Option::hasFlag | ( | unsigned | Val | ) | const [inline] |
Test if this option has the flag Val.
Definition at line 160 of file Option.h.
References llvm::opt::OptTable::Info::Flags, and Info.
Referenced by llvm::opt::OptTable::ParseOneArg().
bool llvm::opt::Option::hasNoOptAsInput | ( | ) | const [inline] |
Definition at line 132 of file Option.h.
References llvm::opt::OptTable::Info::Flags, Info, and llvm::opt::RenderAsInput.
bool llvm::opt::Option::isValid | ( | ) | const [inline] |
bool Option::matches | ( | OptSpecifier | ID | ) | const |
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.
Definition at line 87 of file Option.cpp.
References getAlias(), getGroup(), llvm::opt::OptSpecifier::getID(), getID(), isValid(), and matches().
Referenced by llvm::opt::ArgList::eraseArg(), and matches().
const OptTable::Info* llvm::opt::Option::Info [protected] |
Definition at line 68 of file Option.h.
Referenced by dump(), getAlias(), getAliasArgs(), getGroup(), getID(), getKind(), getName(), getNumArgs(), getPrefix(), getRenderStyle(), hasFlag(), hasNoOptAsInput(), isValid(), and Option().
const OptTable* llvm::opt::Option::Owner [protected] |
Definition at line 69 of file Option.h.
Referenced by getAlias(), and getGroup().