LLVM 24.0.0git
llvm::cl::Option Class Referenceabstract

#include "llvm/Support/CommandLine.h"

Inheritance 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
bool hasArgStr () const
bool isPositional () const
bool isDefaultOption () const
bool isConsumeAfter () 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 addCategory (OptionCategory &C)
void addSubCommand (SubCommand &S)
virtual ~Option ()=default
void addArgument ()
void removeArgument ()
 Unregisters this option from the CommandLine system.
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 error (const Twine &Message, StringRef ArgName=StringRef(), raw_ostream &Errs=llvm::errs())
bool error (const Twine &Message, raw_ostream &Errs)
int getNumOccurrences () const
void reset ()

Static Public Member Functions

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

Public Attributes

StringRef ArgStr
StringRef HelpStr
StringRef ValueStr
SmallVector< OptionCategory *, 1 > Categories
SmallPtrSet< SubCommand *, 1 > Subs

Protected Member Functions

 Option (enum NumOccurrencesFlag OccurrencesFlag, enum OptionHidden Hidden)

Friends

class alias

Detailed Description

Definition at line 247 of file CommandLine.h.

Constructor & Destructor Documentation

◆ Option()

◆ ~Option()

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

References addArgument(), and removeArgument().

Member Function Documentation

◆ addArgument()

void Option::addArgument ( )

Definition at line 462 of file CommandLine.cpp.

References globalParser().

Referenced by ~Option().

◆ addCategory()

void Option::addCategory ( OptionCategory & C)

◆ addOccurrence()

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

Definition at line 1858 of file CommandLine.cpp.

Referenced by CommaSeparateAndAddOccurrence().

◆ addSubCommand()

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

Definition at line 326 of file CommandLine.h.

References Subs.

◆ error() [1/2]

bool llvm::cl::Option::error ( const Twine & Message,
raw_ostream & Errs )
inline

Definition at line 381 of file CommandLine.h.

References error.

◆ error() [2/2]

bool Option::error ( const Twine & Message,
StringRef ArgName = StringRef(),
raw_ostream & Errs = llvm::errs() )

◆ getExtraOptionNames()

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

Definition at line 373 of file CommandLine.h.

◆ getFormattingFlag()

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

Definition at line 297 of file CommandLine.h.

Referenced by HandlePrefixedOrGroupedOption(), isPositional(), and ProvideOption().

◆ getMiscFlags()

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

Definition at line 301 of file CommandLine.h.

Referenced by CommaSeparateAndAddOccurrence(), and isDefaultOption().

◆ getNumOccurrences()

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

Definition at line 385 of file CommandLine.h.

Referenced by llvm::AMDGPUPassConfig::isPassEnabled().

◆ getNumOccurrencesFlag()

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

Definition at line 285 of file CommandLine.h.

Referenced by isConsumeAfter().

◆ getOptionHiddenFlag()

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

Definition at line 293 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 302 of file CommandLine.h.

◆ getValueExpectedFlag()

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

Definition at line 289 of file CommandLine.h.

Referenced by HandlePrefixedOrGroupedOption(), and ProvideOption().

◆ hasArgStr()

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

Definition at line 305 of file CommandLine.h.

References ArgStr.

◆ isConsumeAfter()

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

Definition at line 309 of file CommandLine.h.

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

◆ isDefaultOption()

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

Definition at line 307 of file CommandLine.h.

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

Referenced by reset().

◆ isPositional()

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

Definition at line 306 of file CommandLine.h.

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

◆ printEnumValHelpStr()

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

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

References globalParser().

Referenced by reset(), and ~Option().

◆ reset()

void Option::reset ( )

Definition at line 489 of file CommandLine.cpp.

References isDefaultOption(), removeArgument(), and setDefault().

◆ setArgStr()

void Option::setArgStr ( StringRef S)

◆ setDefault()

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

References HelpStr, printEnumValHelpStr(), and printHelpStr().

Referenced by reset().

◆ setDescription()

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

Definition at line 317 of file CommandLine.h.

References HelpStr.

◆ setFormattingFlag()

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

Definition at line 322 of file CommandLine.h.

◆ setHiddenFlag()

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

Definition at line 321 of file CommandLine.h.

◆ setMiscFlag()

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

Definition at line 323 of file CommandLine.h.

Referenced by setArgStr().

◆ setNumOccurrencesFlag()

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

Definition at line 319 of file CommandLine.h.

◆ setPosition()

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

Definition at line 324 of file CommandLine.h.

◆ setValueExpectedFlag()

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

Definition at line 320 of file CommandLine.h.

◆ setValueStr()

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

Definition at line 318 of file CommandLine.h.

References ValueStr.

◆ alias

friend class alias
friend

Definition at line 248 of file CommandLine.h.

References alias, and llvm::cl::ValueOptional.

Referenced by alias.

Member Data Documentation

◆ ArgStr

StringRef llvm::cl::Option::ArgStr

Definition at line 278 of file CommandLine.h.

Referenced by error(), hasArgStr(), llvm::cl::ProvidePositionalOption(), and setArgStr().

◆ Categories

SmallVector<OptionCategory *, 1> llvm::cl::Option::Categories

Definition at line 282 of file CommandLine.h.

Referenced by addCategory(), and Option().

◆ HelpStr

StringRef llvm::cl::Option::HelpStr

Definition at line 279 of file CommandLine.h.

Referenced by error(), printEnumValHelpStr(), printHelpStr(), setDefault(), and setDescription().

◆ Subs

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

Definition at line 283 of file CommandLine.h.

Referenced by addSubCommand().

◆ ValueStr

StringRef llvm::cl::Option::ValueStr

Definition at line 280 of file CommandLine.h.

Referenced by setValueStr().


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