LLVM  14.0.0git
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 isDefaultOption () 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 addCategory (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(), 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)
 
void setNumAdditionalVals (unsigned n)
 

Friends

class alias
 

Detailed Description

Definition at line 249 of file CommandLine.h.

Constructor & Destructor Documentation

◆ Option()

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

Definition at line 340 of file CommandLine.h.

References Categories, and llvm::cl::getGeneralCategory().

◆ ~Option()

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

Member Function Documentation

◆ addArgument()

void Option::addArgument ( )

Definition at line 447 of file CommandLine.cpp.

References GlobalParser.

◆ addCategory()

void Option::addCategory ( OptionCategory C)

◆ 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 337 of file CommandLine.h.

References S, and Subs.

◆ error() [1/2]

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

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

◆ getFormattingFlag()

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

Definition at line 300 of file CommandLine.h.

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

◆ getMiscFlags()

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

Definition at line 304 of file CommandLine.h.

Referenced by CommaSeparateAndAddOccurrence(), isDefaultOption(), and isSink().

◆ getNumAdditionalVals()

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

Definition at line 306 of file CommandLine.h.

Referenced by ProvideOption().

◆ getNumOccurrences()

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

◆ getNumOccurrencesFlag()

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

Definition at line 288 of file CommandLine.h.

Referenced by addOccurrence(), and isConsumeAfter().

◆ getOptionHiddenFlag()

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

Definition at line 296 of file CommandLine.h.

◆ getOptionWidth()

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

◆ getPosition()

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

◆ getValueExpectedFlag()

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

Definition at line 292 of file CommandLine.h.

Referenced by HandlePrefixedOrGroupedOption(), and ProvideOption().

◆ hasArgStr()

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

◆ isConsumeAfter()

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

Definition at line 314 of file CommandLine.h.

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

◆ isDefaultOption()

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

Definition at line 312 of file CommandLine.h.

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

Referenced by reset().

◆ isInAllSubCommands()

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

Definition at line 318 of file CommandLine.h.

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

◆ isPositional()

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

Definition at line 310 of file CommandLine.h.

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

◆ isSink()

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

Definition at line 311 of file CommandLine.h.

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

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

References GlobalParser.

Referenced by reset().

◆ reset()

void Option::reset ( )

Definition at line 474 of file CommandLine.cpp.

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

◆ setArgStr()

void Option::setArgStr ( StringRef  S)

◆ setDefault()

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

Referenced by reset().

◆ setDescription()

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

Definition at line 328 of file CommandLine.h.

References HelpStr, and S.

◆ setFormattingFlag()

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

Definition at line 333 of file CommandLine.h.

◆ setHiddenFlag()

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

Definition at line 332 of file CommandLine.h.

◆ setMiscFlag()

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

Definition at line 334 of file CommandLine.h.

References M.

Referenced by setArgStr().

◆ setNumAdditionalVals()

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

◆ setNumOccurrencesFlag()

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

Definition at line 330 of file CommandLine.h.

◆ setPosition()

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

Definition at line 335 of file CommandLine.h.

◆ setValueExpectedFlag()

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

Definition at line 331 of file CommandLine.h.

◆ setValueStr()

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

Definition at line 329 of file CommandLine.h.

References S, and ValueStr.

Friends And Related Function Documentation

◆ alias

friend class alias
friend

Definition at line 250 of file CommandLine.h.

Member Data Documentation

◆ ArgStr

StringRef llvm::cl::Option::ArgStr

Definition at line 281 of file CommandLine.h.

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

◆ Categories

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

Definition at line 285 of file CommandLine.h.

Referenced by addCategory(), and Option().

◆ HelpStr

StringRef llvm::cl::Option::HelpStr

Definition at line 282 of file CommandLine.h.

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

◆ Subs

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

Definition at line 286 of file CommandLine.h.

Referenced by addSubCommand(), and isInAllSubCommands().

◆ ValueStr

StringRef llvm::cl::Option::ValueStr

Definition at line 283 of file CommandLine.h.

Referenced by setValueStr().


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