20 using namespace llvm::opt;
23 : Info(info), Owner(owner) {
28 "Multi-level aliases are not supported.");
31 assert(
getAlias().
isValid() &&
"Only alias options can have alias args.");
34 "Cannot provide alias args to a flag option.");
44 #define P(N) case N: llvm::errs() << #N; break
61 for (
const char *
const *Pre =
Info->
Prefixes; *Pre != 0; ++Pre) {
62 llvm::errs() <<
'"' << *Pre << (*(Pre + 1) == 0 ?
"\"" :
"\", ");
105 unsigned ArgSize)
const {
121 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index++);
124 while (*Val !=
'\0') {
135 return new Arg(UnaliasedOption, Spelling, Index++, Value);
140 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index++);
143 const char *Prev = Str;
147 if (!c || c ==
',') {
149 char *
Value =
new char[Str - Prev + 1];
150 memcpy(Value, Prev, Str - Prev);
151 Value[Str - Prev] =
'\0';
175 return new Arg(UnaliasedOption, Spelling,
198 return new Arg(*
this, Spelling, Index++, Value);
206 return new Arg(UnaliasedOption, Spelling,
215 return new Arg(UnaliasedOption, Spelling, Index - 2,
223 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index++);
void push_back(const T &Elt)
bool matches(OptSpecifier ID) const
StringRef getName() const
Get the name of this option without any prefix.
virtual const char * MakeArgString(StringRef Str) const =0
const OptTable::Info * Info
const Option getAlias() const
OptionClass getKind() const
#define llvm_unreachable(msg)
const Option getGroup() const
virtual unsigned getNumInputArgStrings() const =0
unsigned getNumArgs() const
A concrete instance of a particular driver option.
Provide access to the Option info table.
const char *const * Prefixes
StringRef getPrefix() const
Get the default prefix for this option.
virtual const char * getArgString(unsigned Index) const =0
getArgString - Return the input argument string at Index.
size_t strlen(const char *s);
Option(const OptTable::Info *Info, const OptTable *Owner)
Defines the llvm::Arg class for parsed arguments.
void setOwnsValues(bool Value) const
const Option getUnaliasedOption() const
OptSpecifier - Wrapper class for abstracting references to option IDs.
Entry for a single option instance in the option data table.
const char * getAliasArgs() const
Get the alias arguments as a \0 separated list. E.g. ["foo", "bar"] would be returned as "foo\0bar\0"...
LLVM Value Representation.
Arg * accept(const ArgList &Args, unsigned &Index, unsigned ArgSize) const
SmallVectorImpl< const char * > & getValues()