|
LLVM
3.7.0
|
ArgList - Ordered collection of driver arguments. More...
#include <ArgList.h>
Public Types | |
| typedef SmallVector< Arg *, 16 > | arglist_type |
| typedef arglist_type::iterator | iterator |
| typedef arglist_type::const_iterator | const_iterator |
| typedef arglist_type::reverse_iterator | reverse_iterator |
| typedef arglist_type::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
Arg Access | |
| void | append (Arg *A) |
append - Append A to the arg list. More... | |
| arglist_type & | getArgs () |
| const arglist_type & | getArgs () const |
| unsigned | size () const |
| bool | hasArgNoClaim (OptSpecifier Id) const |
hasArg - Does the arg list contain any option matching Id. More... | |
| bool | hasArg (OptSpecifier Id) const |
| bool | hasArg (OptSpecifier Id0, OptSpecifier Id1) const |
| bool | hasArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const |
| Arg * | getLastArgNoClaim (OptSpecifier Id) const |
getLastArg - Return the last argument matching Id, or null. More... | |
| Arg * | getLastArgNoClaim (OptSpecifier Id0, OptSpecifier Id1) const |
| Arg * | getLastArgNoClaim (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const |
| Arg * | getLastArgNoClaim (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3) const |
| Arg * | getLastArg (OptSpecifier Id) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4, OptSpecifier Id5) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4, OptSpecifier Id5, OptSpecifier Id6) const |
| Arg * | getLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4, OptSpecifier Id5, OptSpecifier Id6, OptSpecifier Id7) const |
| virtual const char * | getArgString (unsigned Index) const =0 |
getArgString - Return the input argument string at Index. More... | |
| virtual unsigned | getNumInputArgStrings () const =0 |
| getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be the first strings in the argument string list. More... | |
Arg Iteration | |
| iterator | begin () |
| iterator | end () |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| arg_iterator | filtered_begin (OptSpecifier Id0=0U, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const |
| arg_iterator | filtered_end () const |
| iterator_range< arg_iterator > | filtered (OptSpecifier Id0=0U, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const |
Arg Removal | |
| void | eraseArg (OptSpecifier Id) |
eraseArg - Remove any option matching Id. More... | |
Argument Lookup Utilities | |
| StringRef | getLastArgValue (OptSpecifier Id, StringRef Default="") const |
| getLastArgValue - Return the value of the last argument, or a default. More... | |
| std::vector< std::string > | getAllArgValues (OptSpecifier Id) const |
| getAllArgValues - Get the values of all instances of the given argument as strings. More... | |
Translation Utilities | |
| bool | hasFlag (OptSpecifier Pos, OptSpecifier Neg, bool Default=true) const |
hasFlag - Given an option Pos and its negative form Neg, return true if the option is present, false if the negation is present, and Default if neither option is given. More... | |
| bool | hasFlag (OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg, bool Default=true) const |
hasFlag - Given an option Pos, an alias PosAlias and its negative form Neg, return true if the option or its alias is present, false if the negation is present, and Default if none of the options are given. More... | |
| void | AddLastArg (ArgStringList &Output, OptSpecifier Id0) const |
AddLastArg - Render only the last argument match Id0, if present. More... | |
| void | AddLastArg (ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1) const |
| void | AddAllArgs (ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const |
| AddAllArgs - Render all arguments matching the given ids. More... | |
| void | AddAllArgValues (ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const |
| AddAllArgValues - Render the argument values of all arguments matching the given ids. More... | |
| void | AddAllArgsTranslated (ArgStringList &Output, OptSpecifier Id0, const char *Translation, bool Joined=false) const |
| AddAllArgsTranslated - Render all the arguments matching the given ids, but forced to separate args and using the provided name instead of the first option value. More... | |
| void | ClaimAllArgs (OptSpecifier Id0) const |
| ClaimAllArgs - Claim all arguments which match the given option id. More... | |
| void | ClaimAllArgs () const |
| ClaimAllArgs - Claim all arguments. More... | |
Arg Synthesis | |
| virtual const char * | MakeArgStringRef (StringRef Str) const =0 |
| Construct a constant string pointer whose lifetime will match that of the ArgList. More... | |
| const char * | MakeArgString (const Twine &Str) const |
| const char * | GetOrMakeJoinedArgString (unsigned Index, StringRef LHS, StringRef RHS) const |
Create an arg string for (LHS + RHS), reusing the string at Index if possible. More... | |
Protected Member Functions | |
| ArgList ()=default | |
| ArgList (ArgList &&RHS) | |
| ArgList & | operator= (ArgList &&RHS) |
| ~ArgList ()=default | |
ArgList - Ordered collection of driver arguments.
The ArgList class manages a list of Arg instances as well as auxiliary data and convenience methods to allow Tools to quickly check for the presence of Arg instances for a particular Option and to iterate over groups of arguments.
| typedef SmallVector<Arg*, 16> llvm::opt::ArgList::arglist_type |
|
protecteddefault |
|
inlineprotected |
|
protecteddefault |
| void ArgList::AddAllArgs | ( | ArgStringList & | Output, |
| OptSpecifier | Id0, | ||
| OptSpecifier | Id1 = 0U, |
||
| OptSpecifier | Id2 = 0U |
||
| ) | const |
AddAllArgs - Render all arguments matching the given ids.
Definition at line 261 of file ArgList.cpp.
References llvm::opt::Arg::claim(), filtered(), and llvm::opt::Arg::render().
| void ArgList::AddAllArgsTranslated | ( | ArgStringList & | Output, |
| OptSpecifier | Id0, | ||
| const char * | Translation, | ||
| bool | Joined = false |
||
| ) | const |
AddAllArgsTranslated - Render all the arguments matching the given ids, but forced to separate args and using the provided name instead of the first option value.
| Joined | - If true, render the argument as joined with the option specifier. |
Definition at line 278 of file ArgList.cpp.
References llvm::opt::Arg::claim(), filtered(), llvm::opt::Arg::getValue(), MakeArgString(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
| void ArgList::AddAllArgValues | ( | ArgStringList & | Output, |
| OptSpecifier | Id0, | ||
| OptSpecifier | Id1 = 0U, |
||
| OptSpecifier | Id2 = 0U |
||
| ) | const |
AddAllArgValues - Render the argument values of all arguments matching the given ids.
Definition at line 269 of file ArgList.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::opt::Arg::claim(), filtered(), and llvm::opt::Arg::getValues().
Referenced by getAllArgValues().
| void ArgList::AddLastArg | ( | ArgStringList & | Output, |
| OptSpecifier | Id0 | ||
| ) | const |
AddLastArg - Render only the last argument match Id0, if present.
Definition at line 246 of file ArgList.cpp.
References llvm::ARM_PROC::A, and getLastArg().
| void ArgList::AddLastArg | ( | ArgStringList & | Output, |
| OptSpecifier | Id0, | ||
| OptSpecifier | Id1 | ||
| ) | const |
Definition at line 253 of file ArgList.cpp.
References llvm::ARM_PROC::A, and getLastArg().
| void ArgList::append | ( | Arg * | A | ) |
append - Append A to the arg list.
Definition at line 36 of file ArgList.cpp.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::opt::DerivedArgList::AddFlagArg(), llvm::opt::DerivedArgList::AddJoinedArg(), llvm::opt::DerivedArgList::AddPositionalArg(), and llvm::opt::DerivedArgList::AddSeparateArg().
|
inline |
Definition at line 142 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by ClaimAllArgs(), eraseArg(), and getLastArg().
|
inline |
Definition at line 148 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
| void ArgList::ClaimAllArgs | ( | OptSpecifier | Id0 | ) | const |
ClaimAllArgs - Claim all arguments which match the given option id.
Definition at line 294 of file ArgList.cpp.
References llvm::opt::Arg::claim(), and filtered().
| void ArgList::ClaimAllArgs | ( | ) | const |
ClaimAllArgs - Claim all arguments.
Definition at line 299 of file ArgList.cpp.
|
inline |
Definition at line 143 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by ClaimAllArgs(), eraseArg(), and getLastArg().
|
inline |
Definition at line 149 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
| void ArgList::eraseArg | ( | OptSpecifier | Id | ) |
eraseArg - Remove any option matching Id.
Definition at line 40 of file ArgList.cpp.
References llvm::ARM_PROC::A, begin(), end(), llvm::SmallVectorImpl< T >::erase(), llvm::opt::Arg::getOption(), and llvm::opt::Option::matches().
|
inline |
Definition at line 162 of file ArgList.h.
References filtered_begin(), filtered_end(), and llvm::make_range().
Referenced by AddAllArgs(), AddAllArgsTranslated(), AddAllArgValues(), ClaimAllArgs(), getSearchPaths(), and llvm::libDriverMain().
|
inline |
Definition at line 154 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by filtered(), and llvm::libDriverMain().
|
inline |
Definition at line 158 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by filtered(), and llvm::libDriverMain().
| std::vector< std::string > ArgList::getAllArgValues | ( | OptSpecifier | Id | ) | const |
getAllArgValues - Get the values of all instances of the given argument as strings.
Definition at line 240 of file ArgList.cpp.
References AddAllArgValues(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
|
inline |
|
inline |
getArgString - Return the input argument string at Index.
Implemented in llvm::opt::DerivedArgList, and llvm::opt::InputArgList.
Referenced by llvm::opt::Option::accept(), GetOrMakeJoinedArgString(), and llvm::opt::OptTable::ParseOneArg().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id | ) | const |
Definition at line 83 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
Referenced by AddLastArg(), getLastArgValue(), getOutputPath(), hasArg(), and hasFlag().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1 | ||
| ) | const |
Definition at line 95 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2 | ||
| ) | const |
Definition at line 109 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2, | ||
| OptSpecifier | Id3 | ||
| ) | const |
Definition at line 124 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2, | ||
| OptSpecifier | Id3, | ||
| OptSpecifier | Id4 | ||
| ) | const |
Definition at line 140 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2, | ||
| OptSpecifier | Id3, | ||
| OptSpecifier | Id4, | ||
| OptSpecifier | Id5 | ||
| ) | const |
Definition at line 158 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2, | ||
| OptSpecifier | Id3, | ||
| OptSpecifier | Id4, | ||
| OptSpecifier | Id5, | ||
| OptSpecifier | Id6 | ||
| ) | const |
Definition at line 177 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArg | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2, | ||
| OptSpecifier | Id3, | ||
| OptSpecifier | Id4, | ||
| OptSpecifier | Id5, | ||
| OptSpecifier | Id6, | ||
| OptSpecifier | Id7 | ||
| ) | const |
Definition at line 198 of file ArgList.cpp.
References begin(), llvm::opt::Arg::claim(), and end().
| Arg * ArgList::getLastArgNoClaim | ( | OptSpecifier | Id | ) | const |
getLastArg - Return the last argument matching Id, or null.
Claim Whether the argument should be claimed, if it exists.
Definition at line 46 of file ArgList.cpp.
References rbegin(), and rend().
Referenced by hasArgNoClaim().
| Arg * ArgList::getLastArgNoClaim | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1 | ||
| ) | const |
Definition at line 54 of file ArgList.cpp.
| Arg * ArgList::getLastArgNoClaim | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2 | ||
| ) | const |
Definition at line 63 of file ArgList.cpp.
| Arg * ArgList::getLastArgNoClaim | ( | OptSpecifier | Id0, |
| OptSpecifier | Id1, | ||
| OptSpecifier | Id2, | ||
| OptSpecifier | Id3 | ||
| ) | const |
Definition at line 73 of file ArgList.cpp.
| StringRef ArgList::getLastArgValue | ( | OptSpecifier | Id, |
| StringRef | Default = "" |
||
| ) | const |
getLastArgValue - Return the value of the last argument, or a default.
Definition at line 233 of file ArgList.cpp.
References llvm::ARM_PROC::A, Default, and getLastArg().
|
pure virtual |
getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be the first strings in the argument string list.
Implemented in llvm::opt::DerivedArgList, and llvm::opt::InputArgList.
Referenced by llvm::opt::Option::accept().
| const char * ArgList::GetOrMakeJoinedArgString | ( | unsigned | Index, |
| StringRef | LHS, | ||
| StringRef | RHS | ||
| ) | const |
Create an arg string for (LHS + RHS), reusing the string at Index if possible.
Definition at line 305 of file ArgList.cpp.
References llvm::StringRef::data(), llvm::StringRef::endswith(), getArgString(), MakeArgString(), llvm::StringRef::size(), and llvm::StringRef::startswith().
Referenced by llvm::opt::Arg::render().
|
inline |
Definition at line 185 of file ArgList.h.
References getLastArg().
|
inline |
Definition at line 188 of file ArgList.h.
References getLastArg().
|
inline |
Definition at line 191 of file ArgList.h.
References getLastArg().
|
inline |
hasArg - Does the arg list contain any option matching Id.
Claim Whether the argument should be claimed, if it exists.
Definition at line 182 of file ArgList.h.
References getLastArgNoClaim().
| bool ArgList::hasFlag | ( | OptSpecifier | Pos, |
| OptSpecifier | Neg, | ||
| bool | Default = true |
||
| ) | const |
hasFlag - Given an option Pos and its negative form Neg, return true if the option is present, false if the negation is present, and Default if neither option is given.
If both the option and its negation are present, the last one wins.
Definition at line 220 of file ArgList.cpp.
References llvm::ARM_PROC::A, Default, and getLastArg().
| bool ArgList::hasFlag | ( | OptSpecifier | Pos, |
| OptSpecifier | PosAlias, | ||
| OptSpecifier | Neg, | ||
| bool | Default = true |
||
| ) | const |
hasFlag - Given an option Pos, an alias PosAlias and its negative form Neg, return true if the option or its alias is present, false if the negation is present, and Default if none of the options are given.
If multiple options are present, the last one wins.
Definition at line 226 of file ArgList.cpp.
References llvm::ARM_PROC::A, Default, and getLastArg().
Definition at line 296 of file ArgList.h.
References MakeArgStringRef(), and llvm::Twine::toStringRef().
Referenced by llvm::opt::Option::accept(), AddAllArgsTranslated(), GetOrMakeJoinedArgString(), llvm::opt::DerivedArgList::MakeArgStringRef(), llvm::opt::DerivedArgList::MakeFlagArg(), llvm::opt::DerivedArgList::MakeJoinedArg(), llvm::opt::DerivedArgList::MakePositionalArg(), llvm::opt::DerivedArgList::MakeSeparateArg(), and llvm::opt::Arg::render().
Construct a constant string pointer whose lifetime will match that of the ArgList.
Implemented in llvm::opt::DerivedArgList, and llvm::opt::InputArgList.
Referenced by MakeArgString().
Definition at line 117 of file ArgList.h.
Referenced by llvm::opt::InputArgList::operator=().
|
inline |
Definition at line 145 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rbegin().
Referenced by getLastArgNoClaim().
|
inline |
Definition at line 151 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rbegin().
|
inline |
Definition at line 146 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rend().
Referenced by getLastArgNoClaim().
|
inline |
Definition at line 152 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::rend().
|
inline |
Definition at line 136 of file ArgList.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
1.8.6