LLVM API Documentation

Public Member Functions
llvm::opt::Arg Class Reference

A concrete instance of a particular driver option. More...

#include <Arg.h>

List of all members.

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 OptiongetOption () const
StringRef getSpelling () const
unsigned getIndex () const
const ArggetBaseArg () const
 Return the base argument which generated this arg.
void setBaseArg (const Arg *_BaseArg)
bool getOwnsValues () const
void setOwnsValues (bool Value) const
bool isClaimed () const
void claim () const
 Set the Arg claimed bit.
unsigned getNumValues () const
const char * getValue (unsigned N=0) const
SmallVectorImpl< const char * > & getValues ()
bool containsValue (StringRef Value) const
void render (const ArgList &Args, ArgStringList &Output) const
 Append the argument onto the given array as strings.
void renderAsInput (const ArgList &Args, ArgStringList &Output) const
 Append the argument, render as an input, onto the given array as strings.
void dump () const
std::string getAsString (const ArgList &Args) const
 Return a formatted version of the argument and its values, for debugging and diagnostics.

Detailed Description

A concrete instance of a particular driver option.

The Arg class encodes just enough information to be able to derive the argument values efficiently.

Definition at line 31 of file Arg.h.


Constructor & Destructor Documentation

Arg::Arg ( const Option  Opt,
StringRef  Spelling,
unsigned  Index,
const Arg BaseArg = nullptr 
)

Definition at line 20 of file Arg.cpp.

Arg::Arg ( const Option  Opt,
StringRef  Spelling,
unsigned  Index,
const char *  Value0,
const Arg BaseArg = nullptr 
)
Arg::Arg ( const Option  Opt,
StringRef  Spelling,
unsigned  Index,
const char *  Value0,
const char *  Value1,
const Arg BaseArg = nullptr 
)
Arg::~Arg ( )

Definition at line 40 of file Arg.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::size().


Member Function Documentation

void llvm::opt::Arg::claim ( ) const [inline]
bool llvm::opt::Arg::containsValue ( StringRef  Value) const [inline]

Definition at line 102 of file Arg.h.

References getNumValues().

void Arg::dump ( ) const
std::string Arg::getAsString ( const ArgList Args) const

Return a formatted version of the argument and its values, for debugging and diagnostics.

Definition at line 64 of file Arg.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), render(), and llvm::raw_svector_ostream::str().

const Arg& llvm::opt::Arg::getBaseArg ( ) const [inline]

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().

unsigned llvm::opt::Arg::getIndex ( ) const [inline]

Definition at line 72 of file Arg.h.

Referenced by render().

const Option& llvm::opt::Arg::getOption ( ) const [inline]

Definition at line 70 of file Arg.h.

Referenced by llvm::opt::ArgList::eraseArg(), render(), and renderAsInput().

bool llvm::opt::Arg::getOwnsValues ( ) const [inline]

Definition at line 85 of file Arg.h.

Definition at line 71 of file Arg.h.

Referenced by render().

const char* llvm::opt::Arg::getValue ( unsigned  N = 0) const [inline]

Definition at line 98 of file Arg.h.

Referenced by llvm::opt::Option::accept().

bool llvm::opt::Arg::isClaimed ( ) const [inline]

Definition at line 88 of file Arg.h.

References getBaseArg().

void Arg::render ( const ArgList Args,
ArgStringList Output 
) const
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 80 of file Arg.cpp.

References getNumValues(), getOption(), getValue(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and render().

void llvm::opt::Arg::setBaseArg ( const Arg _BaseArg) [inline]

Definition at line 81 of file Arg.h.

void llvm::opt::Arg::setOwnsValues ( bool  Value) const [inline]

Definition at line 86 of file Arg.h.

Referenced by llvm::opt::Option::accept().


The documentation for this class was generated from the following files: