LLVM API Documentation

llvm::cl::Option Class Reference

#include <CommandLine.h>

Inheritance diagram for llvm::cl::Option:

Inheritance graph
[legend]
Collaboration diagram for llvm::cl::Option:

Collaboration graph
[legend]
List of all members.

Public Member Functions

enum NumOccurrences getNumOccurrencesFlag () const
enum ValueExpected getValueExpectedFlag () const
enum OptionHidden getOptionHiddenFlag () const
enum FormattingFlags getFormattingFlag () const
unsigned getMiscFlags () const
unsigned getPosition () const
bool hasArgStr () const
void setArgStr (const char *S)
void setDescription (const char *S)
void setValueStr (const char *S)
void setFlag (unsigned Flag, unsigned FlagMask)
void setNumOccurrencesFlag (enum NumOccurrences Val)
void setValueExpectedFlag (enum ValueExpected Val)
void setHiddenFlag (enum OptionHidden Val)
void setFormattingFlag (enum FormattingFlags V)
void setMiscFlag (enum MiscFlags M)
void setPosition (unsigned pos)
void addArgument (const char *ArgStr)
void removeArgument (const char *ArgStr)
virtual unsigned getOptionWidth () const=0
virtual void printOptionInfo (unsigned GlobalWidth) const =0
bool addOccurrence (unsigned pos, const char *ArgName, const std::string &Value)
bool error (std::string Message, const char *ArgName=0)
int getNumOccurrences () const
virtual ~Option ()

Public Attributes

const char * ArgStr
const char * HelpStr
const char * ValueStr

Protected Member Functions

 Option ()

Friends

class alias
void cl::ParseCommandLineOptions (int &, char **, const char *)

Detailed Description

Definition at line 129 of file CommandLine.h.


Constructor & Destructor Documentation

llvm::cl::Option::Option (  )  [inline, protected]

Definition at line 217 of file CommandLine.h.

virtual llvm::cl::Option::~Option (  )  [inline, virtual]

Definition at line 245 of file CommandLine.h.


Member Function Documentation

enum NumOccurrences llvm::cl::Option::getNumOccurrencesFlag (  )  const [inline]

Definition at line 164 of file CommandLine.h.

References llvm::cl::OccurrencesMask.

Referenced by addArgument(), addOccurrence(), EatsUnboundedNumberOfValues(), removeArgument(), and RequiresValue().

enum ValueExpected llvm::cl::Option::getValueExpectedFlag (  )  const [inline]

Definition at line 169 of file CommandLine.h.

References llvm::cl::ValueMask.

Referenced by ProvideOption().

enum OptionHidden llvm::cl::Option::getOptionHiddenFlag (  )  const [inline]

Definition at line 174 of file CommandLine.h.

References llvm::cl::HiddenMask.

enum FormattingFlags llvm::cl::Option::getFormattingFlag (  )  const [inline]

Definition at line 179 of file CommandLine.h.

References llvm::cl::FormattingMask.

Referenced by addArgument(), isGrouping(), isPrefixedOrGrouping(), llvm::cl::ParseCommandLineOptions(), and removeArgument().

unsigned llvm::cl::Option::getMiscFlags (  )  const [inline]

Definition at line 184 of file CommandLine.h.

References llvm::cl::MiscMask.

Referenced by llvm::cl::ParseCommandLineOptions().

unsigned llvm::cl::Option::getPosition (  )  const [inline]

Definition at line 187 of file CommandLine.h.

bool llvm::cl::Option::hasArgStr (  )  const [inline]

Definition at line 190 of file CommandLine.h.

References ArgStr.

Referenced by llvm::cl::generic_parser_base::getOptionWidth(), llvm::cl::generic_parser_base::initialize(), and llvm::cl::generic_parser_base::printOptionInfo().

void llvm::cl::Option::setArgStr ( const char *  S  )  [inline]

Definition at line 195 of file CommandLine.h.

References ArgStr.

void llvm::cl::Option::setDescription ( const char *  S  )  [inline]

Definition at line 196 of file CommandLine.h.

References HelpStr.

Referenced by llvm::cl::desc::apply().

void llvm::cl::Option::setValueStr ( const char *  S  )  [inline]

Definition at line 197 of file CommandLine.h.

References ValueStr.

Referenced by llvm::cl::value_desc::apply().

void llvm::cl::Option::setFlag ( unsigned  Flag,
unsigned  FlagMask 
) [inline]

Definition at line 199 of file CommandLine.h.

References error().

Referenced by setFormattingFlag(), setHiddenFlag(), setMiscFlag(), setNumOccurrencesFlag(), and setValueExpectedFlag().

void llvm::cl::Option::setNumOccurrencesFlag ( enum NumOccurrences  Val  )  [inline]

Definition at line 208 of file CommandLine.h.

References llvm::cl::OccurrencesMask, and setFlag().

Referenced by llvm::cl::applicator< NumOccurrences >::opt().

void llvm::cl::Option::setValueExpectedFlag ( enum ValueExpected  Val  )  [inline]

Definition at line 211 of file CommandLine.h.

References setFlag(), and llvm::cl::ValueMask.

Referenced by llvm::cl::applicator< ValueExpected >::opt().

void llvm::cl::Option::setHiddenFlag ( enum OptionHidden  Val  )  [inline]

Definition at line 212 of file CommandLine.h.

References llvm::cl::HiddenMask, and setFlag().

Referenced by llvm::cl::applicator< OptionHidden >::opt().

void llvm::cl::Option::setFormattingFlag ( enum FormattingFlags  V  )  [inline]

Definition at line 213 of file CommandLine.h.

References llvm::cl::FormattingMask, and setFlag().

Referenced by llvm::cl::applicator< FormattingFlags >::opt().

void llvm::cl::Option::setMiscFlag ( enum MiscFlags  M  )  [inline]

Definition at line 214 of file CommandLine.h.

References setFlag().

Referenced by llvm::cl::applicator< MiscFlags >::opt().

void llvm::cl::Option::setPosition ( unsigned  pos  )  [inline]

Definition at line 215 of file CommandLine.h.

void Option::addArgument ( const char *  ArgStr  ) 

Definition at line 649 of file CommandLine.cpp.

References AddArgument(), llvm::cl::ConsumeAfter, error(), getFormattingFlag(), getNumOccurrencesFlag(), getPositionalOpts(), and llvm::cl::Positional.

Referenced by llvm::cl::generic_parser_base::initialize(), and llvm::PassNameParser::passRegistered().

void Option::removeArgument ( const char *  ArgStr  ) 

Definition at line 663 of file CommandLine.cpp.

References llvm::cl::ConsumeAfter, getFormattingFlag(), getNumOccurrencesFlag(), getPositionalOpts(), llvm::cl::Positional, and RemoveArgument().

Referenced by llvm::PassNameParser::passUnregistered().

virtual unsigned llvm::cl::Option::getOptionWidth (  )  const [pure virtual]

virtual void llvm::cl::Option::printOptionInfo ( unsigned  GlobalWidth  )  const [pure virtual]

bool Option::addOccurrence ( unsigned  pos,
const char *  ArgName,
const std::string &  Value 
)

Definition at line 624 of file CommandLine.cpp.

References llvm::cl::ConsumeAfter, error(), getNumOccurrencesFlag(), llvm::cl::OneOrMore, llvm::cl::Optional, llvm::cl::Required, and llvm::cl::ZeroOrMore.

Referenced by ProvideOption().

bool Option::error ( std::string  Message,
const char *  ArgName = 0 
)

Definition at line 614 of file CommandLine.cpp.

References ArgStr, HelpStr, and ProgramName.

Referenced by addArgument(), addOccurrence(), llvm::cl::parser< const llvm::PassInfo * >::parse(), llvm::cl::ParseCommandLineOptions(), parseDouble(), ProvideOption(), llvm::cl::alias::setAliasFor(), setFlag(), llvm::cl::bits_storage< DataType, Storage >::setLocation(), llvm::cl::list_storage< DataType, Storage >::setLocation(), and llvm::cl::opt_storage< DataType, ExternalStorage, llvm::is_class< DataType >::value >::setLocation().

int llvm::cl::Option::getNumOccurrences (  )  const [inline]

Definition at line 244 of file CommandLine.h.


Friends And Related Function Documentation

friend class alias [friend]

Definition at line 131 of file CommandLine.h.

void cl::ParseCommandLineOptions ( int &  ,
char **  ,
const char *   
) [friend]


Member Data Documentation

const char* llvm::cl::Option::ArgStr

Definition at line 160 of file CommandLine.h.

Referenced by error(), llvm::cl::generic_parser_base::getOptionWidth(), llvm::cl::basic_parser_impl::getOptionWidth(), hasArgStr(), llvm::cl::generic_parser_base::printOptionInfo(), llvm::cl::basic_parser_impl::printOptionInfo(), ProvidePositionalOption(), and setArgStr().

const char* llvm::cl::Option::HelpStr

Definition at line 161 of file CommandLine.h.

Referenced by error(), llvm::cl::generic_parser_base::printOptionInfo(), llvm::cl::basic_parser_impl::printOptionInfo(), and setDescription().

const char* llvm::cl::Option::ValueStr

Definition at line 162 of file CommandLine.h.

Referenced by getValueStr(), and setValueStr().


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