LLVM API Documentation

Public Types | Public Member Functions | Protected Member Functions
llvm::opt::ArgList Class Reference

#include <ArgList.h>

Inheritance diagram for llvm::opt::ArgList:
Inheritance graph
[legend]

List of all members.

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

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_iteratorfiltered (OptSpecifier Id0=0U, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
void eraseArg (OptSpecifier Id)
 eraseArg - Remove any option matching Id.
bool hasArgNoClaim (OptSpecifier Id) const
bool hasArg (OptSpecifier Id) const
bool hasArg (OptSpecifier Id0, OptSpecifier Id1) const
bool hasArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const
ArggetLastArgNoClaim (OptSpecifier Id) const
ArggetLastArgNoClaim (OptSpecifier Id0, OptSpecifier Id1) const
ArggetLastArg (OptSpecifier Id) const
ArggetLastArg (OptSpecifier Id0, OptSpecifier Id1) const
ArggetLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const
ArggetLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3) const
ArggetLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4) const
ArggetLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4, OptSpecifier Id5) const
ArggetLastArg (OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, OptSpecifier Id3, OptSpecifier Id4, OptSpecifier Id5, OptSpecifier Id6) const
ArggetLastArg (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.
virtual unsigned getNumInputArgStrings () const =0
StringRef getLastArgValue (OptSpecifier Id, StringRef Default="") const
 getLastArgValue - Return the value of the last argument, or a default.
std::vector< std::string > getAllArgValues (OptSpecifier Id) const
bool hasFlag (OptSpecifier Pos, OptSpecifier Neg, bool Default=true) const
bool hasFlag (OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg, bool Default=true) const
void AddLastArg (ArgStringList &Output, OptSpecifier Id0) const
 AddLastArg - Render only the last argument match Id0, if present.
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.
void AddAllArgValues (ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
void AddAllArgsTranslated (ArgStringList &Output, OptSpecifier Id0, const char *Translation, bool Joined=false) const
void ClaimAllArgs (OptSpecifier Id0) const
void ClaimAllArgs () const
virtual const char * MakeArgString (StringRef Str) const =0
const char * MakeArgString (const char *Str) const
const char * MakeArgString (std::string Str) const
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.
Arg Access
void append (Arg *A)
 append - Append A to the arg list.
arglist_typegetArgs ()
const arglist_typegetArgs () const
unsigned size () const

Protected Member Functions

 ArgList ()
virtual ~ArgList ()

Detailed Description

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.

Definition at line 92 of file ArgList.h.


Member Typedef Documentation

Definition at line 98 of file ArgList.h.

Definition at line 100 of file ArgList.h.

Definition at line 102 of file ArgList.h.

Definition at line 99 of file ArgList.h.

Definition at line 101 of file ArgList.h.


Constructor & Destructor Documentation

llvm::opt::ArgList::ArgList ( ) [inline, protected]

Definition at line 111 of file ArgList.h.

ArgList::~ArgList ( ) [protected, virtual]

Definition at line 36 of file ArgList.cpp.


Member Function Documentation

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 244 of file ArgList.cpp.

References llvm::opt::Arg::claim(), 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.

Parameters:
Joined- If true, render the argument as joined with the option specifier.

Definition at line 261 of file ArgList.cpp.

References llvm::opt::Arg::claim(), llvm::opt::Arg::getValue(), 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 252 of file ArgList.cpp.

References llvm::opt::Arg::claim(), llvm::opt::Arg::getNumValues(), llvm::opt::Arg::getValue(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

void ArgList::AddLastArg ( ArgStringList Output,
OptSpecifier  Id0 
) const

AddLastArg - Render only the last argument match Id0, if present.

Definition at line 229 of file ArgList.cpp.

References llvm::ARM_PROC::A.

void ArgList::AddLastArg ( ArgStringList Output,
OptSpecifier  Id0,
OptSpecifier  Id1 
) const

Definition at line 236 of file ArgList.cpp.

References llvm::ARM_PROC::A.

void ArgList::append ( Arg A)

Definition at line 131 of file ArgList.h.

Referenced by llvm::opt::InputArgList::~InputArgList().

Definition at line 137 of file ArgList.h.

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

void ArgList::ClaimAllArgs ( OptSpecifier  Id0) const

ClaimAllArgs - Claim all arguments which match the given option id.

Definition at line 277 of file ArgList.cpp.

References llvm::opt::Arg::claim().

void ArgList::ClaimAllArgs ( ) const

ClaimAllArgs - Claim all arguments.

Definition at line 282 of file ArgList.cpp.

References llvm::sys::path::begin(), and llvm::sys::path::end().

eraseArg - Remove any option matching Id.

Definition at line 43 of file ArgList.cpp.

References llvm::ARM_PROC::A, llvm::sys::path::begin(), llvm::sys::path::end(), llvm::opt::Arg::getOption(), and llvm::opt::Option::matches().

iterator_range<arg_iterator> llvm::opt::ArgList::filtered ( OptSpecifier  Id0 = 0U,
OptSpecifier  Id1 = 0U,
OptSpecifier  Id2 = 0U 
) const [inline]

Definition at line 151 of file ArgList.h.

arg_iterator llvm::opt::ArgList::filtered_begin ( OptSpecifier  Id0 = 0U,
OptSpecifier  Id1 = 0U,
OptSpecifier  Id2 = 0U 
) const [inline]

Definition at line 143 of file ArgList.h.

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

Definition at line 147 of file ArgList.h.

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 223 of file ArgList.cpp.

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

Definition at line 124 of file ArgList.h.

Definition at line 125 of file ArgList.h.

virtual const char* llvm::opt::ArgList::getArgString ( unsigned  Index) const [pure virtual]

getArgString - Return the input argument string at Index.

Implemented in llvm::opt::DerivedArgList, and llvm::opt::InputArgList.

Referenced by llvm::opt::Option::accept(), and llvm::opt::OptTable::ParseOneArg().

Definition at line 66 of file ArgList.cpp.

References llvm::sys::path::begin(), llvm::opt::Arg::claim(), and llvm::sys::path::end().

Referenced by hasArg().

Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1 
) const
Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2 
) const
Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2,
OptSpecifier  Id3 
) const
Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2,
OptSpecifier  Id3,
OptSpecifier  Id4 
) const
Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2,
OptSpecifier  Id3,
OptSpecifier  Id4,
OptSpecifier  Id5 
) const
Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2,
OptSpecifier  Id3,
OptSpecifier  Id4,
OptSpecifier  Id5,
OptSpecifier  Id6 
) const
Arg * ArgList::getLastArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2,
OptSpecifier  Id3,
OptSpecifier  Id4,
OptSpecifier  Id5,
OptSpecifier  Id6,
OptSpecifier  Id7 
) const

getLastArg - Return the last argument matching Id, or null.

Claim Whether the argument should be claimed, if it exists.

Definition at line 49 of file ArgList.cpp.

References llvm::sys::path::rbegin(), and llvm::sys::path::rend().

Referenced by hasArg().

Definition at line 57 of file ArgList.cpp.

References llvm::sys::path::rbegin(), and llvm::sys::path::rend().

StringRef ArgList::getLastArgValue ( OptSpecifier  Id,
StringRef  Default = "" 
) const

getLastArgValue - Return the value of the last argument, or a default.

Definition at line 216 of file ArgList.cpp.

References llvm::ARM_PROC::A, and Default.

virtual unsigned llvm::opt::ArgList::getNumInputArgStrings ( ) const [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 293 of file ArgList.cpp.

References llvm::StringRef::data(), llvm::StringRef::endswith(), llvm::StringRef::size(), and llvm::StringRef::startswith().

Referenced by llvm::opt::Arg::render().

Definition at line 170 of file ArgList.h.

bool llvm::opt::ArgList::hasArg ( OptSpecifier  Id0,
OptSpecifier  Id1 
) const [inline]

Definition at line 173 of file ArgList.h.

References getLastArgNoClaim().

bool llvm::opt::ArgList::hasArg ( OptSpecifier  Id0,
OptSpecifier  Id1,
OptSpecifier  Id2 
) const [inline]

Definition at line 176 of file ArgList.h.

References getLastArg().

hasArg - Does the arg list contain any option matching Id.

Claim Whether the argument should be claimed, if it exists.

Definition at line 167 of file ArgList.h.

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 203 of file ArgList.cpp.

References llvm::ARM_PROC::A, and Default.

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 209 of file ArgList.cpp.

References llvm::ARM_PROC::A, and Default.

virtual const char* llvm::opt::ArgList::MakeArgString ( StringRef  Str) const [pure virtual]

MakeArgString - Construct a constant string pointer whose lifetime will match that of the ArgList.

Implemented in llvm::opt::DerivedArgList, and llvm::opt::InputArgList.

Referenced by llvm::opt::Option::accept(), and llvm::opt::Arg::render().

const char* llvm::opt::ArgList::MakeArgString ( const char *  Str) const [inline]

Definition at line 271 of file ArgList.h.

const char* llvm::opt::ArgList::MakeArgString ( std::string  Str) const [inline]

Definition at line 274 of file ArgList.h.

const char * ArgList::MakeArgString ( const Twine Str) const

Definition at line 288 of file ArgList.cpp.

References llvm::Twine::toStringRef().

Definition at line 134 of file ArgList.h.

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

Definition at line 140 of file ArgList.h.

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

unsigned llvm::opt::ArgList::size ( ) const [inline]

Definition at line 127 of file ArgList.h.

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


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