21 using namespace llvm::opt;
24 : Info(info), Owner(owner) {
29 "Multi-level aliases are not supported.");
35 "Cannot provide alias args to a flag option.");
42 #define P(N) case N: O << #N; break
60 for (
const char *
const *Pre =
Info->
Prefixes; *Pre !=
nullptr; ++Pre) {
61 O <<
'"' << *Pre << (*(Pre + 1) ==
nullptr ?
"\"" :
"\", ");
66 O <<
" Name:\"" <<
getName() <<
'"';
122 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index++);
125 while (*Val !=
'\0') {
129 Val += strlen(Val) + 1;
141 return new Arg(UnaliasedOption, Spelling, Index++, Value);
146 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index++);
149 const char *Prev = Str;
153 if (!c || c ==
',') {
155 char *
Value =
new char[Str - Prev + 1];
156 memcpy(Value, Prev, Str - Prev);
157 Value[Str - Prev] =
'\0';
182 return new Arg(UnaliasedOption, Spelling,
205 return new Arg(*
this, Spelling, Index++, Value);
214 return new Arg(UnaliasedOption, Spelling,
224 return new Arg(UnaliasedOption, Spelling, Index - 2,
232 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index++);
239 Arg *
A =
new Arg(UnaliasedOption, Spelling, Index);
void push_back(const T &Elt)
bool matches(OptSpecifier ID) const
matches - Predicate for whether this option is part of the given option (which may be a group)...
StringRef getName() const
Get the name of this option without any prefix.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
const OptTable::Info * Info
const Option getAlias() const
OptionClass getKind() const
void print(raw_ostream &O) const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const Option getGroup() const
SmallVectorImpl< const char * > & getValues()
virtual unsigned getNumInputArgStrings() const =0
getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be th...
unsigned getNumArgs() const
Option - Abstract representation for a single form of driver argument.
A concrete instance of a particular driver option.
Provide access to the Option info table.
const char *const * Prefixes
A null terminated array of prefix strings to apply to name while matching.
const char * MakeArgString(const Twine &Str) const
StringRef getPrefix() const
Get the default prefix for this option.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
virtual const char * getArgString(unsigned Index) const =0
getArgString - Return the input argument string at Index.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
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
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias)...
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
Arg * accept(const ArgList &Args, unsigned &Index, unsigned ArgSize) const
accept - Potentially accept the current argument, returning a new Arg instance, or 0 if the option do...
StringRef - Represent a constant reference to a string, i.e.
ArgList - Ordered collection of driver arguments.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")