18 using namespace llvm::opt;
20 void arg_iterator::SkipToNextArg() {
21 for (; Current != Args.
end(); ++Current) {
27 const Option &O = (*Current)->getOption();
49 if ((*it)->getOption().matches(Id)) {
61 if ((*it)->getOption().matches(Id))
69 if ((*it)->getOption().matches(Id)) {
81 if ((*it)->getOption().matches(Id0) ||
82 (*it)->getOption().matches(Id1)) {
96 if ((*it)->getOption().matches(Id0) ||
97 (*it)->getOption().matches(Id1) ||
98 (*it)->getOption().matches(Id2)) {
111 if ((*it)->getOption().matches(Id0) ||
112 (*it)->getOption().matches(Id1) ||
113 (*it)->getOption().matches(Id2) ||
114 (*it)->getOption().matches(Id3)) {
128 if ((*it)->getOption().matches(Id0) ||
129 (*it)->getOption().matches(Id1) ||
130 (*it)->getOption().matches(Id2) ||
131 (*it)->getOption().matches(Id3) ||
132 (*it)->getOption().matches(Id4)) {
146 if ((*it)->getOption().matches(Id0) ||
147 (*it)->getOption().matches(Id1) ||
148 (*it)->getOption().matches(Id2) ||
149 (*it)->getOption().matches(Id3) ||
150 (*it)->getOption().matches(Id4) ||
151 (*it)->getOption().matches(Id5)) {
166 if ((*it)->getOption().matches(Id0) ||
167 (*it)->getOption().matches(Id1) ||
168 (*it)->getOption().matches(Id2) ||
169 (*it)->getOption().matches(Id3) ||
170 (*it)->getOption().matches(Id4) ||
171 (*it)->getOption().matches(Id5) ||
172 (*it)->getOption().matches(Id6)) {
187 if ((*it)->getOption().matches(Id0) ||
188 (*it)->getOption().matches(Id1) ||
189 (*it)->getOption().matches(Id2) ||
190 (*it)->getOption().matches(Id3) ||
191 (*it)->getOption().matches(Id4) ||
192 (*it)->getOption().matches(Id5) ||
193 (*it)->getOption().matches(Id6) ||
194 (*it)->getOption().matches(Id7)) {
205 return A->getOption().matches(Pos);
212 return A->getOption().matches(Pos) ||
A->getOption().matches(PosAlias);
219 return A->getValue();
226 return std::vector<std::string>(Values.
begin(), Values.
end());
232 A->render(*
this, Output);
240 A->render(*
this, Output);
249 (*it)->render(*
this, Output);
258 for (
unsigned i = 0, e = (*it)->getNumValues(); i != e; ++i)
264 const char *Translation,
272 (*it)->getValue(0)));
288 if (!(*it)->isClaimed())
312 const char*
const *ArgEnd)
313 : NumInputArgStrings(ArgEnd - ArgBegin) {
314 ArgStrings.
append(ArgBegin, ArgEnd);
324 unsigned Index = ArgStrings.
size();
327 SynthesizedStrings.push_back(String0);
328 ArgStrings.
push_back(SynthesizedStrings.back().c_str());
337 assert(Index0 + 1 == Index1 &&
"Unexpected non-consecutive indices!");
349 : BaseArgs(_BaseArgs) {
373 unsigned Index = BaseArgs.
MakeIndex(Value);
void toVector(SmallVectorImpl< char > &Out) const
virtual const char * MakeArgString(StringRef Str) const
void push_back(const T &Elt)
bool matches(OptSpecifier ID) const
StringRef getName() const
Get the name of this option without any prefix.
size_t size() const
size - Get the string size.
virtual const char * MakeArgString(StringRef Str) const =0
void AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0, const char *Translation, bool Joined=false) const
bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
Arg * MakeFlagArg(const Arg *BaseArg, const Option Opt) const
MakeFlagArg - Construct a new FlagArg for the given option Id.
std::string str() const
str - Get the contents as an std::string.
void AddAllArgs(ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
AddAllArgs - Render all arguments matching the given ids.
arglist_type::const_reverse_iterator const_reverse_iterator
void eraseArg(OptSpecifier Id)
eraseArg - Remove any option matching Id.
reverse_iterator rbegin()
arg_iterator - Iterates through arguments stored inside an ArgList.
const char * data() const
Arg * getLastArgNoClaim(OptSpecifier Id) const
arg_iterator filtered_end() const
A concrete instance of a particular driver option.
DerivedArgList(const InputArgList &BaseArgs)
Construct a new derived arg list from BaseArgs.
void claim() const
Set the Arg claimed bit.
const char * GetOrMakeJoinedArgString(unsigned Index, StringRef LHS, StringRef RHS) const
Create an arg string for (LHS + RHS), reusing the string at Index if possible.
bool hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default=true) const
StringRef getPrefix() const
Get the default prefix for this option.
void append(in_iter in_start, in_iter in_end)
iterator erase(iterator I)
void AddLastArg(ArgStringList &Output, OptSpecifier Id0) const
AddLastArg - Render only the last argument match Id0, if present.
void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
virtual const char * getArgString(unsigned Index) const =0
getArgString - Return the input argument string at Index.
Arg * MakeJoinedArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
StringRef str() const
Explicit conversion to StringRef.
Defines the llvm::Arg class for parsed arguments.
Arg * MakeSeparateArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
Arg * MakePositionalArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
void ClaimAllArgs() const
void append(Arg *A)
append - Append A to the arg list.
OptSpecifier - Wrapper class for abstracting references to option IDs.
Arg * getLastArg(OptSpecifier Id) const
std::vector< std::string > getAllArgValues(OptSpecifier Id) const
LLVM Value Representation.
arg_iterator filtered_begin(OptSpecifier Id0=0U, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
StringRef getLastArgValue(OptSpecifier Id, StringRef Default="") const
getLastArgValue - Return the value of the last argument, or a default.