11 #include "llvm/Config/llvm-config.h" 27 :
Info(info), Owner(owner) {
31 "Multi-level aliases are not supported.");
37 "Cannot provide alias args to a flag option.");
44 #define P(N) case N: O << #N; break 63 for (
const char *
const *Pre =
Info->
Prefixes; *Pre !=
nullptr; ++Pre) {
64 O <<
'"' << *Pre << (*(Pre + 1) ==
nullptr ?
"\"" :
"\", ");
69 O <<
" Name:\"" <<
getName() <<
'"';
89 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 111 unsigned ArgSize)
const {
127 Arg *A =
new Arg(UnaliasedOption, Spelling, Index++);
130 while (*Val !=
'\0') {
134 Val += strlen(Val) + 1;
146 return new Arg(UnaliasedOption, Spelling, Index++, Value);
151 Arg *A =
new Arg(UnaliasedOption, Spelling, Index++);
154 const char *Prev = Str;
158 if (!c || c ==
',') {
160 char *
Value =
new char[Str - Prev + 1];
161 memcpy(Value, Prev, Str - Prev);
162 Value[Str - Prev] =
'\0';
187 return new Arg(UnaliasedOption, Spelling,
210 return new Arg(*
this, Spelling, Index++, Value);
219 return new Arg(UnaliasedOption, Spelling,
229 return new Arg(UnaliasedOption, Spelling, Index - 2,
237 Arg *A =
new Arg(UnaliasedOption, Spelling, Index++);
244 Arg *A =
new Arg(UnaliasedOption, Spelling, Index);
StringRef getPrefix() const
Get the default prefix for this option.
This class represents lattice values for constants.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
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
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
#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.
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...