clang API Documentation

Public Member Functions | Static Public Member Functions
clang::driver::Arg Class Reference

#include <Arg.h>

List of all members.

Public Member Functions

 Arg (const Option *Opt, unsigned Index, const Arg *BaseArg=0)
 Arg (const Option *Opt, unsigned Index, const char *Value0, const Arg *BaseArg=0)
 Arg (const Option *Opt, unsigned Index, const char *Value0, const char *Value1, const Arg *BaseArg=0)
 ~Arg ()
const OptiongetOption () const
unsigned getIndex () const
const ArggetBaseArg () const
void setBaseArg (const Arg *_BaseArg)
bool getOwnsValues () const
void setOwnsValues (bool Value) const
bool isClaimed () const
void claim () const
 claim - Set the Arg claimed bit.
unsigned getNumValues () const
const char * getValue (const ArgList &Args, unsigned N=0) const
SmallVectorImpl< const char * > & getValues ()
bool containsValue (StringRef Value) const
void render (const ArgList &Args, ArgStringList &Output) const
 render - Append the argument onto the given array as strings.
void renderAsInput (const ArgList &Args, ArgStringList &Output) const
void dump () const
std::string getAsString (const ArgList &Args) const

Static Public Member Functions

static bool classof (const Arg *)

Detailed Description

Arg - 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 30 of file Arg.h.


Constructor & Destructor Documentation

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

Definition at line 19 of file Arg.cpp.

Arg::Arg ( const Option Opt,
unsigned  Index,
const char *  Value0,
const Arg BaseArg = 0 
)

Definition at line 24 of file Arg.cpp.

Arg::Arg ( const Option Opt,
unsigned  Index,
const char *  Value0,
const char *  Value1,
const Arg BaseArg = 0 
)

Definition at line 31 of file Arg.cpp.

Arg::~Arg ( )

Definition at line 39 of file Arg.cpp.


Member Function Documentation

void clang::driver::Arg::claim ( ) const [inline]
static bool clang::driver::Arg::classof ( const Arg ) [inline, static]

Definition at line 110 of file Arg.h.

bool clang::driver::Arg::containsValue ( StringRef  Value) const [inline]

Definition at line 94 of file Arg.h.

References getNumValues().

void Arg::dump ( ) const

Definition at line 46 of file Arg.cpp.

References clang::driver::Option::dump().

std::string Arg::getAsString ( const ArgList Args) const
const Arg& clang::driver::Arg::getBaseArg ( ) const [inline]

getBaseArg - 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 70 of file Arg.h.

Referenced by claim(), and isClaimed().

unsigned clang::driver::Arg::getIndex ( ) const [inline]

Definition at line 65 of file Arg.h.

Referenced by render().

unsigned clang::driver::Arg::getNumValues ( ) const [inline]
const Option& clang::driver::Arg::getOption ( ) const [inline]
bool clang::driver::Arg::getOwnsValues ( ) const [inline]

Definition at line 77 of file Arg.h.

const char* clang::driver::Arg::getValue ( const ArgList Args,
unsigned  N = 0 
) const [inline]
SmallVectorImpl<const char*>& clang::driver::Arg::getValues ( ) [inline]
bool clang::driver::Arg::isClaimed ( ) const [inline]

Definition at line 80 of file Arg.h.

References getBaseArg().

Referenced by clang::driver::Driver::BuildJobs().

void Arg::render ( const ArgList Args,
ArgStringList Output 
) const
void Arg::renderAsInput ( const ArgList Args,
ArgStringList Output 
) const

renderAsInput - 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 79 of file Arg.cpp.

References getNumValues(), getOption(), getValue(), and render().

Referenced by AddLinkerInputs(), and clang::driver::tools::Clang::ConstructJob().

void clang::driver::Arg::setBaseArg ( const Arg _BaseArg) [inline]

Definition at line 73 of file Arg.h.

Referenced by clang::driver::toolchains::Darwin::TranslateArgs().

void clang::driver::Arg::setOwnsValues ( bool  Value) const [inline]

Definition at line 78 of file Arg.h.

Referenced by clang::driver::CommaJoinedOption::accept().


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