LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::opt::Arg Class Reference

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=0)
 
 Arg (const Option Opt, StringRef Spelling, unsigned Index, const char *Value0, const Arg *BaseArg=0)
 
 Arg (const Option Opt, StringRef Spelling, unsigned Index, const char *Value0, const char *Value1, const Arg *BaseArg=0)
 
 ~Arg ()
 
const Option getOption () const
 
StringRef getSpelling () const
 
unsigned getIndex () const
 
const ArggetBaseArg () 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 ()
 
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 dump () const
 
std::string getAsString (const ArgList &Args) const
 Return a formatted version of the argument and its values, for debugging and diagnostics. More...
 

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. In addition, Arg instances have an intrusive double linked list which is used by ArgList to provide efficient iteration over all instances of a particular option.

Definition at line 34 of file Arg.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file Arg.cpp.

Arg::Arg ( const Option  Opt,
StringRef  Spelling,
unsigned  Index,
const char *  Value0,
const Arg BaseArg = 0 
)
Arg::Arg ( const Option  Opt,
StringRef  Spelling,
unsigned  Index,
const char *  Value0,
const char *  Value1,
const Arg BaseArg = 0 
)
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

Set the Arg claimed bit.

Definition at line 94 of file Arg.h.

References getBaseArg().

Referenced by llvm::opt::ArgList::getLastArg().

bool llvm::opt::Arg::containsValue ( StringRef  Value) const
inline

Definition at line 105 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 81 of file Arg.h.

Referenced by claim(), and isClaimed().

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

Definition at line 75 of file Arg.h.

Referenced by render().

unsigned llvm::opt::Arg::getNumValues ( ) const
inline

Definition at line 96 of file Arg.h.

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

Referenced by containsValue(), render(), and renderAsInput().

const Option llvm::opt::Arg::getOption ( ) const
inline

Definition at line 73 of file Arg.h.

Referenced by render(), and renderAsInput().

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

Definition at line 88 of file Arg.h.

StringRef llvm::opt::Arg::getSpelling ( ) const
inline

Definition at line 74 of file Arg.h.

Referenced by render().

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

Definition at line 97 of file Arg.h.

References N.

Referenced by render(), and renderAsInput().

SmallVectorImpl<const char*>& llvm::opt::Arg::getValues ( )
inline

Definition at line 101 of file Arg.h.

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

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

Definition at line 91 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 84 of file Arg.h.

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

Definition at line 89 of file Arg.h.

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


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