12 #include "llvm/Config/llvm-config.h" 28 :
Info(info), Owner(owner) {
32 "Multi-level aliases are not supported.");
38 "Cannot provide alias args to a flag option.");
45 #define P(N) case N: O << #N; break 64 for (
const char *
const *Pre =
Info->
Prefixes; *Pre !=
nullptr; ++Pre) {
65 O <<
'"' << *Pre << (*(Pre + 1) ==
nullptr ?
"\"" :
"\", ");
70 O <<
" Name:\"" <<
getName() <<
'"';
90 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 112 unsigned ArgSize)
const {
128 Arg *A =
new Arg(UnaliasedOption, Spelling, Index++);
131 while (*Val !=
'\0') {
135 Val += strlen(Val) + 1;
147 return new Arg(UnaliasedOption, Spelling, Index++, Value);
152 Arg *A =
new Arg(UnaliasedOption, Spelling, Index++);
155 const char *Prev = Str;
159 if (!c || c ==
',') {
161 char *
Value =
new char[Str - Prev + 1];
162 memcpy(Value, Prev, Str - Prev);
163 Value[Str - Prev] =
'\0';
188 return new Arg(UnaliasedOption, Spelling,
211 return new Arg(*
this, Spelling, Index++, Value);
220 return new Arg(UnaliasedOption, Spelling,
230 return new Arg(UnaliasedOption, Spelling, Index - 2,
238 Arg *A =
new Arg(UnaliasedOption, Spelling, Index++);
245 Arg *A =
new Arg(UnaliasedOption, Spelling, Index);
StringRef getPrefix() const
Get the default prefix for this option.
This class represents lattice values for constants.
const Option getUnaliasedOption() const
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias)...
void push_back(const T &Elt)
const OptTable::Info * Info
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void print(raw_ostream &O) const
SmallVectorImpl< const char * > & getValues()
virtual unsigned getNumInputArgStrings() const =0
getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be th...
Analysis containing CSE Info
OptionClass getKind() const
Option - Abstract representation for a single form of driver argument.
StringRef getName() const
Get the name of this option without any prefix.
bool matches(OptSpecifier ID) const
matches - Predicate for whether this option is part of the given option (which may be a group)...
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
const Option getGroup() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const Option getAlias() const
virtual const char * getArgString(unsigned Index) const =0
getArgString - Return the input argument string at Index.
unsigned getNumArgs() const
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.
amdgpu Simplify well known AMD library false Value Value * Arg
OptSpecifier - Wrapper class for abstracting references to option IDs.
Entry for a single option instance in the option data table.
void setOwnsValues(bool Value) const
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...
StringRef - Represent a constant reference to a string, i.e.
ArgList - Ordered collection of driver arguments.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
const char * getAliasArgs() const
Get the alias arguments as a \0 separated list.
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...