LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CommandLine.cpp File Reference

#include "llvm/Config/config.h"
#include "llvm/Support/CommandLine.h"
#include <algorithm>
#include <map>
#include <set>
#include <iostream>
#include <cstdlib>
#include <cerrno>
#include <cstring>

Include dependency graph for CommandLine.cpp:

Go to the source code of this file.

Namespaces

namespace  cl

Functions

static std::vector< const
char * > & 
MoreHelp ()
static std::map< std::string,
Option * > & 
getOpts ()
static Option * getOption (const std::string &Str)
static std::vector< Option * > & getPositionalOpts ()
static void AddArgument (const char *ArgName, Option *Opt)
static void RemoveArgument (const char *ArgName, Option *Opt)
static bool ProvideOption (Option *Handler, const char *ArgName, const char *Value, int argc, char **argv, int &i)
static bool ProvidePositionalOption (Option *Handler, const std::string &Arg, int i)
static bool isGrouping (const Option *O)
static bool isPrefixedOrGrouping (const Option *O)
static Option * getOptionPred (std::string Name, unsigned &Length, bool(*Pred)(const Option *))
static bool RequiresValue (const Option *O)
static bool EatsUnboundedNumberOfValues (const Option *O)
static void ParseCStringVector (std::vector< char * > &output, const char *input)
void cl::ParseEnvironmentOptions (const char *progName, const char *envVar, const char *Overview)
static Option * LookupOption (const char *&Arg, const char *&Value)
void cl::ParseCommandLineOptions (int &argc, char **argv, const char *Overview)
static const char * getValueStr (const Option &O, const char *DefaultMsg)
static bool parseDouble (Option &O, const std::string &Arg, double &Value)
HelpPrinter NormalPrinter (false)
HelpPrinter HiddenPrinter (true)
void cl::PrintHelpMessage ()

Variables

static const char * ProgramName = "<unknown>"
static const char * ProgramOverview = 0


Function Documentation

static void AddArgument const char *  ArgName,
Option *  Opt
[static]
 

Definition at line 69 of file CommandLine.cpp.

References getOption(), getOpts(), and ProgramName.

static bool EatsUnboundedNumberOfValues const Option *  O  )  [static]
 

Definition at line 179 of file CommandLine.cpp.

References llvm::cl::OneOrMore, and llvm::cl::ZeroOrMore.

Referenced by cl::ParseCommandLineOptions().

static Option* getOption const std::string &  Str  )  [static]
 

Definition at line 59 of file CommandLine.cpp.

References getOpts(), and I.

Referenced by AddArgument(), getOptionPred(), and RemoveArgument().

static Option* getOptionPred std::string  Name,
unsigned &  Length,
bool(*)(const Option *)  Pred
[static]
 

Definition at line 148 of file CommandLine.cpp.

References getOption().

Referenced by cl::ParseCommandLineOptions().

static std::map<std::string, Option*>& getOpts  )  [static]
 

Definition at line 54 of file CommandLine.cpp.

Referenced by AddArgument(), getOption(), LookupOption(), cl::ParseCommandLineOptions(), and RemoveArgument().

static std::vector<Option*>& getPositionalOpts  )  [static]
 

Definition at line 64 of file CommandLine.cpp.

References llvm::cl::Positional.

Referenced by cl::ParseCommandLineOptions().

static const char* getValueStr const Option &  O,
const char *  DefaultMsg
[static]
 

Definition at line 652 of file CommandLine.cpp.

HelpPrinter @0::HiddenPrinter true   )  [static]
 

static bool isGrouping const Option *  O  )  [inline, static]
 

Definition at line 135 of file CommandLine.cpp.

References llvm::cl::Grouping.

Referenced by isPrefixedOrGrouping(), and cl::ParseCommandLineOptions().

static bool isPrefixedOrGrouping const Option *  O  )  [inline, static]
 

Definition at line 138 of file CommandLine.cpp.

References isGrouping(), and llvm::cl::Prefix.

Referenced by cl::ParseCommandLineOptions().

static Option* LookupOption const char *&  Arg,
const char *&  Value
[static]
 

LookupOption - Lookup the option specified by the specified option on the command line. If there is a value specified (after an equal sign) return that as well.

Definition at line 266 of file CommandLine.cpp.

References getOpts(), and I.

Referenced by cl::ParseCommandLineOptions().

static std::vector<const char*>& MoreHelp  )  [static]
 

Definition at line 37 of file CommandLine.cpp.

Referenced by cl::ParseCommandLineOptions().

HelpPrinter @0::NormalPrinter false   )  [static]
 

Referenced by cl::PrintHelpMessage().

static void ParseCStringVector std::vector< char * > &  output,
const char *  input
[static]
 

ParseCStringVector - Break INPUT up wherever one or more whitespace characters are found, and store the resulting tokens in OUTPUT. The tokens stored in OUTPUT are dynamically allocated using strdup (), so it is the caller's responsibility to free () them later.

Definition at line 190 of file CommandLine.cpp.

References strdup.

Referenced by cl::ParseEnvironmentOptions().

static bool parseDouble Option &  O,
const std::string &  Arg,
double &  Value
[static]
 

Definition at line 752 of file CommandLine.cpp.

static bool ProvideOption Option *  Handler,
const char *  ArgName,
const char *  Value,
int  argc,
char **  argv,
int &  i
[inline, static]
 

Definition at line 94 of file CommandLine.cpp.

References abort(), ProgramName, llvm::cl::ValueDisallowed, llvm::cl::ValueOptional, and llvm::cl::ValueRequired.

Referenced by cl::ParseCommandLineOptions(), and ProvidePositionalOption().

static bool ProvidePositionalOption Option *  Handler,
const std::string &  Arg,
int  i
[static]
 

Definition at line 127 of file CommandLine.cpp.

References ProvideOption().

Referenced by cl::ParseCommandLineOptions().

static void RemoveArgument const char *  ArgName,
Option *  Opt
[static]
 

Definition at line 82 of file CommandLine.cpp.

References getOption(), and getOpts().

static bool RequiresValue const Option *  O  )  [static]
 

Definition at line 174 of file CommandLine.cpp.

References llvm::cl::OneOrMore, and llvm::cl::Required.

Referenced by cl::ParseCommandLineOptions().


Variable Documentation

cl::opt<HelpPrinter, true, parser<bool> > HHOp("help-hidden", cl::desc("display all available options"), cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed) [static]
 

cl::opt<HelpPrinter, true, parser<bool> > HOp("help", cl::desc("display available options (--help-hidden for more)"), cl::location(NormalPrinter), cl::ValueDisallowed) [static]
 

const char* ProgramName = "<unknown>" [static]
 

Definition at line 33 of file CommandLine.cpp.

Referenced by AddArgument(), cl::ParseCommandLineOptions(), and ProvideOption().

const char* ProgramOverview = 0 [static]
 

Definition at line 34 of file CommandLine.cpp.

Referenced by cl::ParseCommandLineOptions().

VersionPrinter VersionPrinterInstance [static]
 

Definition at line 953 of file CommandLine.cpp.

cl::opt<VersionPrinter, true, parser<bool> > VersOp("version", cl::desc("display the version"), cl::location(VersionPrinterInstance), cl::ValueDisallowed) [static]