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

#include "llvm/Support/CommandLine.h"

Inheritance diagram for llvm::cl::Option:
Inheritance graph
[legend]
Collaboration diagram for llvm::cl::Option:
Collaboration graph
[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 setDefault ()=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 ()
 

Static Public Member Functions

static void printHelpStr (StringRef HelpStr, size_t Indent, size_t FirstLineIndentedBy)
 

Public Attributes

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

Protected Member Functions

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

Friends

class alias
 

Detailed Description

Definition at line 233 of file CommandLine.h.

Constructor & Destructor Documentation

◆ Option()

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

Definition at line 322 of file CommandLine.h.

◆ ~Option()

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

Member Function Documentation

◆ addArgument()

void Option::addArgument ( )

Definition at line 356 of file CommandLine.cpp.

◆ addOccurrence()

bool Option::addOccurrence ( unsigned  pos,
StringRef  ArgName,
StringRef  Value,
bool  MultiArg = false 
)
virtual

◆ addSubCommand()

void llvm::cl::Option::addSubCommand ( SubCommand S)
inline

Definition at line 319 of file CommandLine.h.

References llvm::SmallPtrSetImpl< PtrType >::insert().

◆ error()

bool Option::error ( const Twine Message,
StringRef  ArgName = StringRef() 
)

◆ getExtraOptionNames()

virtual void llvm::cl::Option::getExtraOptionNames ( SmallVectorImpl< StringRef > &  )
inlinevirtual

Definition at line 357 of file CommandLine.h.

References error.

Referenced by llvm::cl::basic_parser_impl::anchor(), and LookupNearestOption().

◆ getFormattingFlag()

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

◆ getMiscFlags()

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

◆ getNumAdditionalVals()

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

Definition at line 289 of file CommandLine.h.

Referenced by ProvideOption().

◆ getNumOccurrences()

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

Definition at line 367 of file CommandLine.h.

Referenced by getCodeModel(), getSchedRegions(), nextIfDebug(), and setFunctionAttributes().

◆ getNumOccurrencesFlag()

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

◆ getOptionHiddenFlag()

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

Definition at line 279 of file CommandLine.h.

◆ getOptionWidth()

virtual size_t llvm::cl::Option::getOptionWidth ( ) const
pure virtual

◆ getPosition()

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

Definition at line 288 of file CommandLine.h.

◆ getValueExpectedFlag()

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

◆ hasArgStr()

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

◆ isConsumeAfter()

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

Definition at line 296 of file CommandLine.h.

References llvm::cl::ConsumeAfter.

Referenced by llvm::cl::basic_parser_impl::anchor().

◆ isInAllSubCommands()

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

◆ isPositional()

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

Definition at line 293 of file CommandLine.h.

References llvm::cl::Positional.

Referenced by llvm::cl::basic_parser_impl::anchor().

◆ isSink()

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

Definition at line 294 of file CommandLine.h.

References llvm::cl::Sink.

Referenced by llvm::cl::basic_parser_impl::anchor().

◆ printHelpStr()

void Option::printHelpStr ( StringRef  HelpStr,
size_t  Indent,
size_t  FirstLineIndentedBy 
)
static

◆ printOptionInfo()

virtual void llvm::cl::Option::printOptionInfo ( size_t  GlobalWidth) const
pure virtual

◆ printOptionValue()

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

◆ removeArgument()

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 361 of file CommandLine.cpp.

◆ reset()

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

Definition at line 368 of file CommandLine.h.

◆ setArgStr()

void Option::setArgStr ( StringRef  S)

Definition at line 363 of file CommandLine.cpp.

References assert(), llvm::StringRef::empty(), and llvm::cl::GeneralCategory.

◆ setCategory()

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

Definition at line 318 of file CommandLine.h.

References C.

◆ setDefault()

virtual void llvm::cl::Option::setDefault ( )
pure virtual

◆ setDescription()

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

Definition at line 310 of file CommandLine.h.

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

◆ setFormattingFlag()

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

Definition at line 315 of file CommandLine.h.

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

◆ setHiddenFlag()

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

Definition at line 314 of file CommandLine.h.

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

◆ setMiscFlag()

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

Definition at line 316 of file CommandLine.h.

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

◆ setNumAdditionalVals()

void llvm::cl::Option::setNumAdditionalVals ( unsigned  n)
inlineprotected

◆ setNumOccurrencesFlag()

void llvm::cl::Option::setNumOccurrencesFlag ( enum NumOccurrencesFlag  Val)
inline

Definition at line 312 of file CommandLine.h.

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

◆ setPosition()

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

Definition at line 317 of file CommandLine.h.

◆ setValueExpectedFlag()

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

Definition at line 313 of file CommandLine.h.

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

◆ setValueStr()

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

Definition at line 311 of file CommandLine.h.

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

Friends And Related Function Documentation

◆ alias

friend class alias
friend

Definition at line 234 of file CommandLine.h.

Member Data Documentation

◆ ArgStr

StringRef llvm::cl::Option::ArgStr

◆ Category

OptionCategory* llvm::cl::Option::Category

Definition at line 267 of file CommandLine.h.

Referenced by sortSubCommands().

◆ FullyInitialized

bool llvm::cl::Option::FullyInitialized = false

Definition at line 269 of file CommandLine.h.

◆ HelpStr

StringRef llvm::cl::Option::HelpStr

◆ Subs

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

Definition at line 268 of file CommandLine.h.

Referenced by llvm::cl::basic_parser_impl::anchor().

◆ ValueStr

StringRef llvm::cl::Option::ValueStr

Definition at line 266 of file CommandLine.h.

Referenced by getValueStr().


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