|
LLVM
4.0.0
|
A concrete instance of a particular driver option. More...
#include <Arg.h>
Public Member Functions | |
| Arg (const Option Opt, StringRef Spelling, unsigned Index, const Arg *BaseArg=nullptr) | |
| Arg (const Option Opt, StringRef Spelling, unsigned Index, const char *Value0, const Arg *BaseArg=nullptr) | |
| Arg (const Option Opt, StringRef Spelling, unsigned Index, const char *Value0, const char *Value1, const Arg *BaseArg=nullptr) | |
| ~Arg () | |
| const Option & | getOption () const |
| StringRef | getSpelling () const |
| unsigned | getIndex () const |
| const Arg & | getBaseArg () const |
| Return the base argument which generated this arg. More... | |
| void | setBaseArg (const Arg *BaseArg) |
| bool | getOwnsValues () const |
| void | setOwnsValues (bool Value) const |
| bool | isClaimed () const |
| void | claim () const |
| Set the Arg claimed bit. More... | |
| unsigned | getNumValues () const |
| const char * | getValue (unsigned N=0) const |
| SmallVectorImpl< const char * > & | getValues () |
| const SmallVectorImpl< const char * > & | getValues () const |
| bool | containsValue (StringRef Value) const |
| void | render (const ArgList &Args, ArgStringList &Output) const |
| Append the argument onto the given array as strings. More... | |
| void | renderAsInput (const ArgList &Args, ArgStringList &Output) const |
| Append the argument, render as an input, onto the given array as strings. More... | |
| void | print (raw_ostream &O) const |
| void | dump () const |
| std::string | getAsString (const ArgList &Args) const |
| Return a formatted version of the argument and its values, for debugging and diagnostics. More... | |
A concrete instance of a particular driver option.
The Arg class encodes just enough information to be able to derive the argument values efficiently.
| Arg::Arg | ( | const Option | Opt, |
| StringRef | Spelling, | ||
| unsigned | Index, | ||
| const char * | Value0, | ||
| const Arg * | BaseArg = nullptr |
||
| ) |
Definition at line 25 of file Arg.cpp.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
| Arg::Arg | ( | const Option | Opt, |
| StringRef | Spelling, | ||
| unsigned | Index, | ||
| const char * | Value0, | ||
| const char * | Value1, | ||
| const Arg * | BaseArg = nullptr |
||
| ) |
Definition at line 32 of file Arg.cpp.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
| Arg::~Arg | ( | ) |
Definition at line 40 of file Arg.cpp.
References i, and llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
Set the Arg claimed bit.
Definition at line 89 of file Arg.h.
References getBaseArg().
Referenced by llvm::opt::ArgList::AddAllArgs(), llvm::opt::ArgList::AddAllArgsExcept(), llvm::opt::ArgList::AddAllArgsTranslated(), llvm::opt::ArgList::AddAllArgValues(), llvm::opt::ArgList::ClaimAllArgs(), and llvm::opt::ArgList::getLastArg().
Definition at line 99 of file Arg.h.
References getNumValues(), and i.
| LLVM_DUMP_METHOD void Arg::dump | ( | ) | const |
Definition at line 64 of file Arg.cpp.
References llvm::dbgs(), and print().
Return a formatted version of the argument and its values, for debugging and diagnostics.
Definition at line 66 of file Arg.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), render(), and llvm::raw_svector_ostream::str().
Return the base argument which generated this arg.
This is either the argument itself or the argument it was derived from during tool chain specific argument translation.
Definition at line 78 of file Arg.h.
Referenced by claim(), and isClaimed().
|
inline |
|
inline |
Definition at line 91 of file Arg.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by containsValue(), and render().
Definition at line 70 of file Arg.h.
Referenced by llvm::opt::ArgList::AddAllArgsExcept(), llvm::opt::ArgList::eraseArg(), render(), and renderAsInput().
|
inline |
Definition at line 92 of file Arg.h.
References N.
Referenced by llvm::opt::ArgList::AddAllArgsTranslated(), and render().
|
inline |
Definition at line 96 of file Arg.h.
Referenced by llvm::opt::Option::accept(), and llvm::opt::ArgList::AddAllArgValues().
|
inline |
|
inline |
Definition at line 86 of file Arg.h.
References getBaseArg().
| void Arg::print | ( | raw_ostream & | O | ) | const |
Definition at line 47 of file Arg.cpp.
References i, llvm::opt::Option::print(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by dump(), and llvm::opt::ArgList::print().
| void Arg::render | ( | const ArgList & | Args, |
| ArgStringList & | Output | ||
| ) | const |
Append the argument onto the given array as strings.
Definition at line 91 of file Arg.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), getIndex(), getNumValues(), getOption(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), getSpelling(), getValue(), i, llvm::opt::ArgList::MakeArgString(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::opt::Option::RenderCommaJoinedStyle, llvm::opt::Option::RenderJoinedStyle, llvm::opt::Option::RenderSeparateStyle, llvm::opt::Option::RenderValuesStyle, and llvm::raw_svector_ostream::str().
Referenced by llvm::opt::ArgList::AddAllArgs(), llvm::opt::ArgList::AddAllArgsExcept(), getAsString(), and renderAsInput().
| void Arg::renderAsInput | ( | const ArgList & | Args, |
| ArgStringList & | Output | ||
| ) | const |
Append the argument, render as an input, onto the given array as strings.
The distinction is that some options only render their values when rendered as a input (e.g., Xlinker).
Definition at line 82 of file Arg.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), getOption(), and render().
|
inline |
Definition at line 84 of file Arg.h.
Referenced by llvm::opt::Option::accept().
1.8.6