LLVM  4.0.0
Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
llvm::cl::Option Class Referenceabstract

#include <CommandLine.h>

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

Public Member Functions

enum NumOccurrencesFlag getNumOccurrencesFlag () const
 
enum ValueExpected getValueExpectedFlag () const
 
enum OptionHidden getOptionHiddenFlag () const
 
enum FormattingFlags getFormattingFlag () const
 
unsigned getMiscFlags () const
 
unsigned getPosition () const
 
unsigned getNumAdditionalVals () const
 
bool hasArgStr () const
 
bool isPositional () const
 
bool isSink () const
 
bool isConsumeAfter () const
 
bool isInAllSubCommands () const
 
void setArgStr (StringRef S)
 
void setDescription (StringRef S)
 
void setValueStr (StringRef S)
 
void setNumOccurrencesFlag (enum NumOccurrencesFlag 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 setCategory (OptionCategory &C)
 
void addSubCommand (SubCommand &S)
 
virtual ~Option ()=default
 
void addArgument ()
 
void removeArgument ()
 Unregisters this option from the CommandLine system. More...
 
virtual size_t getOptionWidth () const =0
 
virtual void printOptionInfo (size_t GlobalWidth) const =0
 
virtual void printOptionValue (size_t GlobalWidth, bool Force) const =0
 
virtual void getExtraOptionNames (SmallVectorImpl< StringRef > &)
 
virtual bool addOccurrence (unsigned pos, StringRef ArgName, StringRef Value, bool MultiArg=false)
 
bool error (const Twine &Message, StringRef ArgName=StringRef())
 
int getNumOccurrences () const
 
void reset ()
 

Public Attributes

StringRef ArgStr
 
StringRef HelpStr
 
StringRef ValueStr
 
OptionCategoryCategory
 
SmallPtrSet< SubCommand *, 4 > Subs
 
bool FullyInitialized
 

Protected Member Functions

 Option (enum NumOccurrencesFlag OccurrencesFlag, enum OptionHidden Hidden)
 
void setNumAdditionalVals (unsigned n)
 

Friends

class alias
 

Detailed Description

Definition at line 225 of file CommandLine.h.

Constructor & Destructor Documentation

llvm::cl::Option::Option ( enum NumOccurrencesFlag  OccurrencesFlag,
enum OptionHidden  Hidden 
)
inlineexplicitprotected

Definition at line 314 of file CommandLine.h.

virtual llvm::cl::Option::~Option ( )
virtualdefault

Member Function Documentation

void Option::addArgument ( )

Definition at line 366 of file CommandLine.cpp.

References FullyInitialized, and GlobalParser.

bool Option::addOccurrence ( unsigned  pos,
StringRef  ArgName,
StringRef  Value,
bool  MultiArg = false 
)
virtual
void llvm::cl::Option::addSubCommand ( SubCommand S)
inline

Definition at line 311 of file CommandLine.h.

References Subs.

bool Option::error ( const Twine Message,
StringRef  ArgName = StringRef() 
)
virtual void llvm::cl::Option::getExtraOptionNames ( SmallVectorImpl< StringRef > &  )
inlinevirtual

Definition at line 346 of file CommandLine.h.

Referenced by LookupNearestOption().

enum FormattingFlags llvm::cl::Option::getFormattingFlag ( ) const
inline
unsigned llvm::cl::Option::getMiscFlags ( ) const
inline

Definition at line 279 of file CommandLine.h.

Referenced by CommaSeparateAndAddOccurrence(), and isSink().

unsigned llvm::cl::Option::getNumAdditionalVals ( ) const
inline

Definition at line 281 of file CommandLine.h.

Referenced by ProvideOption().

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

Definition at line 356 of file CommandLine.h.

enum NumOccurrencesFlag llvm::cl::Option::getNumOccurrencesFlag ( ) const
inline
enum OptionHidden llvm::cl::Option::getOptionHiddenFlag ( ) const
inline

Definition at line 271 of file CommandLine.h.

virtual size_t llvm::cl::Option::getOptionWidth ( ) const
pure virtual
unsigned llvm::cl::Option::getPosition ( ) const
inline

Definition at line 280 of file CommandLine.h.

enum ValueExpected llvm::cl::Option::getValueExpectedFlag ( ) const
inline
bool llvm::cl::Option::hasArgStr ( ) const
inline
bool llvm::cl::Option::isConsumeAfter ( ) const
inline

Definition at line 288 of file CommandLine.h.

References llvm::cl::ConsumeAfter, and getNumOccurrencesFlag().

bool llvm::cl::Option::isInAllSubCommands ( ) const
inline

Definition at line 292 of file CommandLine.h.

References llvm::cl::AllSubCommands, llvm::any_of(), llvm::PPCISD::SC, and Subs.

bool llvm::cl::Option::isPositional ( ) const
inline

Definition at line 285 of file CommandLine.h.

References getFormattingFlag(), and llvm::cl::Positional.

bool llvm::cl::Option::isSink ( ) const
inline

Definition at line 286 of file CommandLine.h.

References getMiscFlags(), and llvm::cl::Sink.

virtual void llvm::cl::Option::printOptionInfo ( size_t  GlobalWidth) const
pure virtual
virtual void llvm::cl::Option::printOptionValue ( size_t  GlobalWidth,
bool  Force 
) const
pure virtual
void Option::removeArgument ( )

Unregisters this option from the CommandLine system.

This option must have been the last option registered. For testing purposes only.

Definition at line 371 of file CommandLine.cpp.

References GlobalParser.

void llvm::cl::Option::reset ( )
inline

Definition at line 357 of file CommandLine.h.

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

void Option::setArgStr ( StringRef  S)

Definition at line 373 of file CommandLine.cpp.

References ArgStr, assert(), llvm::StringRef::empty(), FullyInitialized, and GlobalParser.

void llvm::cl::Option::setCategory ( OptionCategory C)
inline

Definition at line 310 of file CommandLine.h.

References C, and Category.

void llvm::cl::Option::setDescription ( StringRef  S)
inline

Definition at line 302 of file CommandLine.h.

References HelpStr.

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

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

Definition at line 307 of file CommandLine.h.

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

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

Definition at line 306 of file CommandLine.h.

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

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

Definition at line 308 of file CommandLine.h.

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

void llvm::cl::Option::setNumAdditionalVals ( unsigned  n)
inlineprotected
void llvm::cl::Option::setNumOccurrencesFlag ( enum NumOccurrencesFlag  Val)
inline

Definition at line 304 of file CommandLine.h.

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

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

Definition at line 309 of file CommandLine.h.

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

Definition at line 305 of file CommandLine.h.

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

void llvm::cl::Option::setValueStr ( StringRef  S)
inline

Definition at line 303 of file CommandLine.h.

References ValueStr.

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

Friends And Related Function Documentation

friend class alias
friend

Definition at line 226 of file CommandLine.h.

Member Data Documentation

StringRef llvm::cl::Option::ArgStr
OptionCategory* llvm::cl::Option::Category

Definition at line 259 of file CommandLine.h.

Referenced by setCategory().

bool llvm::cl::Option::FullyInitialized

Definition at line 261 of file CommandLine.h.

Referenced by addArgument(), and setArgStr().

StringRef llvm::cl::Option::HelpStr
SmallPtrSet<SubCommand *, 4> llvm::cl::Option::Subs

Definition at line 260 of file CommandLine.h.

Referenced by addSubCommand(), and isInAllSubCommands().

StringRef llvm::cl::Option::ValueStr

Definition at line 258 of file CommandLine.h.

Referenced by getValueStr(), and setValueStr().


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