LLVM API Documentation

llvm::cl Namespace Reference


Classes

class  Option
struct  desc
struct  value_desc
struct  initializer
struct  LocationClass
class  ValuesClass
struct  generic_parser_base
class  parser
struct  basic_parser_impl
struct  basic_parser
class  parser< bool >
class  parser< int >
class  parser< unsigned >
class  parser< double >
class  parser< float >
struct  applicator
struct  applicator< char[n]>
struct  applicator< const char[n]>
struct  applicator< const char * >
struct  applicator< NumOccurrences >
struct  applicator< ValueExpected >
struct  applicator< OptionHidden >
struct  applicator< FormattingFlags >
struct  applicator< MiscFlags >
class  opt_storage
class  opt_storage< DataType, false, true >
class  opt_storage< DataType, false, false >
class  opt
class  list_storage
class  list_storage< DataType, bool >
class  list
class  bits_storage
class  bits_storage< DataType, bool >
class  bits
class  alias
struct  aliasopt
struct  extrahelp
class  parser< std::string >

Enumerations

enum  NumOccurrences {
  Optional = 0x01, ZeroOrMore = 0x02, Required = 0x03, OneOrMore = 0x04,
  ConsumeAfter = 0x05, OccurrencesMask = 0x07
}
enum  ValueExpected { ValueOptional = 0x08, ValueRequired = 0x10, ValueDisallowed = 0x18, ValueMask = 0x18 }
enum  OptionHidden { NotHidden = 0x20, Hidden = 0x40, ReallyHidden = 0x60, HiddenMask = 0x60 }
enum  FormattingFlags {
  NormalFormatting = 0x000, Positional = 0x080, Prefix = 0x100, Grouping = 0x180,
  FormattingMask = 0x180
}
enum  MiscFlags { CommaSeparated = 0x200, PositionalEatsArgs = 0x400, MiscMask = 0x600 }

Functions

void ParseCommandLineOptions (int &argc, char **argv, const char *Overview=0)
void ParseEnvironmentOptions (const char *progName, const char *envvar, const char *Overview=0)
template<class Ty>
initializer< Tyinit (const Ty &Val)
template<class Ty>
LocationClass< Tylocation (Ty &L)
template<class DataType>
ValuesClass< DataType > END_WITH_NULL values (const char *Arg, DataType Val, const char *Desc,...)
template<class Mod, class Opt>
void apply (const Mod &M, Opt *O)
void PrintHelpMessage ()


Detailed Description

cl Namespace - This namespace contains all of the command line option processing machinery. It is intentionally a short name to make qualified usage concise.


Enumeration Type Documentation

enum llvm::cl::NumOccurrences

Enumerator:
Optional 
ZeroOrMore 
Required 
OneOrMore 
ConsumeAfter 
OccurrencesMask 

Definition at line 55 of file CommandLine.h.

enum llvm::cl::ValueExpected

Enumerator:
ValueOptional 
ValueRequired 
ValueDisallowed 
ValueMask 

Definition at line 73 of file CommandLine.h.

enum llvm::cl::OptionHidden

Enumerator:
NotHidden 
Hidden 
ReallyHidden 
HiddenMask 

Definition at line 80 of file CommandLine.h.

enum llvm::cl::FormattingFlags

Enumerator:
NormalFormatting 
Positional 
Prefix 
Grouping 
FormattingMask 

Definition at line 102 of file CommandLine.h.

enum llvm::cl::MiscFlags

Enumerator:
CommaSeparated 
PositionalEatsArgs 
MiscMask 

Definition at line 110 of file CommandLine.h.


Function Documentation

void llvm::cl::ParseCommandLineOptions ( int &  argc,
char **  argv,
const char *  Overview = 0 
)

Definition at line 287 of file CommandLine.cpp.

References CommaSeparated, ConsumeAfter, E, EatsUnboundedNumberOfValues(), llvm::cl::Option::error(), first, llvm::cl::Option::getFormattingFlag(), llvm::cl::Option::getMiscFlags(), getOptionPred(), getOpts(), getPositionalOpts(), I, isGrouping(), isPrefixedOrGrouping(), LookupOption(), MoreHelp(), OneOrMore, Optional, Positional, PositionalEatsArgs, Prefix, ProgramName, ProgramOverview, ProvideOption(), ProvidePositionalOption(), Required, RequiresValue(), second, Val, ValueRequired, and ZeroOrMore.

Referenced by ParseEnvironmentOptions().

void llvm::cl::ParseEnvironmentOptions ( const char *  progName,
const char *  envVar,
const char *  Overview = 0 
)

ParseEnvironmentOptions - An alternative entry point to the CommandLine library, which allows you to read the program's name from the caller (as PROGNAME) and its command-line arguments from an environment variable (whose name is given in ENVVAR).

Definition at line 235 of file CommandLine.cpp.

References ParseCommandLineOptions(), ParseCStringVector(), and strdup.

template<class Ty>
initializer<Ty> llvm::cl::init ( const Ty Val  ) 

Definition at line 273 of file CommandLine.h.

Referenced by GetElementPtrConstantExpr::GetElementPtrConstantExpr(), llvm::ReturnInst::ReturnInst(), llvm::SelectInst::SelectInst(), llvm::ShiftInst::ShiftInst(), and llvm::SwitchInst::SwitchInst().

template<class Ty>
LocationClass<Ty> llvm::cl::location ( Ty L  ) 

Definition at line 292 of file CommandLine.h.

template<class DataType>
ValuesClass<DataType> END_WITH_NULL llvm::cl::values ( const char *  Arg,
DataType  Val,
const char *  Desc,
  ... 
)

Definition at line 338 of file CommandLine.h.

References Val.

template<class Mod, class Opt>
void llvm::cl::apply ( const Mod M,
Opt *  O 
)

Definition at line 647 of file CommandLine.h.

Referenced by llvm::cl::alias::alias(), llvm::cl::bits< DataType, Storage, ParserClass >::bits(), llvm::cl::list< DataType, Storage, ParserClass >::list(), and llvm::cl::opt< DataType, ExternalStorage, ParserClass >::opt().

void llvm::cl::PrintHelpMessage (  ) 

Definition at line 996 of file CommandLine.cpp.

References NormalPrinter().