LLVM API Documentation

CommandLine.cpp File Reference

#include "llvm/Config/config.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Streams.h"
#include "llvm/System/Path.h"
#include <algorithm>
#include <functional>
#include <map>
#include <ostream>
#include <set>
#include <cstdlib>
#include <cerrno>
#include <cstring>
#include <climits>

Include dependency graph for CommandLine.cpp:

Go to the source code of this file.

Functions

 TEMPLATE_INSTANTIATION (class basic_parser< bool >)
 TEMPLATE_INSTANTIATION (class basic_parser< boolOrDefault >)
 TEMPLATE_INSTANTIATION (class basic_parser< int >)
 TEMPLATE_INSTANTIATION (class basic_parser< unsigned >)
 TEMPLATE_INSTANTIATION (class basic_parser< double >)
 TEMPLATE_INSTANTIATION (class basic_parser< float >)
 TEMPLATE_INSTANTIATION (class basic_parser< std::string >)
 TEMPLATE_INSTANTIATION (class opt< unsigned >)
 TEMPLATE_INSTANTIATION (class opt< int >)
 TEMPLATE_INSTANTIATION (class opt< std::string >)
 TEMPLATE_INSTANTIATION (class opt< bool >)
static void GetOptionInfo (std::vector< Option * > &PositionalOpts, std::vector< Option * > &SinkOpts, std::map< std::string, Option * > &OptionsMap)
static Option * LookupOption (const char *&Arg, const char *&Value, std::map< std::string, Option * > &OptionsMap)
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, size_t &Length, bool(*Pred)(const Option *), std::map< std::string, Option * > &OptionsMap)
static bool RequiresValue (const Option *O)
static bool EatsUnboundedNumberOfValues (const Option *O)
static void ParseCStringVector (std::vector< char * > &output, const char *input)
static void ExpandResponseFiles (int argc, char **argv, std::vector< char * > &newArgv)
static const char * getValueStr (const Option &O, const char *DefaultMsg)
static bool parseDouble (Option &O, const std::string &Arg, double &Value)
static HelpPrinter NormalPrinter (false)
static HelpPrinter HiddenPrinter (true)

Variables

static char ProgramName [80] = "<premain>"
static const char * ProgramOverview = 0
static ManagedStatic
< std::vector< const char * > > 
MoreHelp
static bool OptionListChanged = false
static Option * RegisteredOptionList = 0
static cl::opt< HelpPrinter,
true, parser< bool > > 
HOp ("help", cl::desc("Display available options (--help-hidden for more)"), cl::location(NormalPrinter), cl::ValueDisallowed)
static cl::opt< HelpPrinter,
true, parser< bool > > 
HHOp ("help-hidden", cl::desc("Display all available options"), cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed)
static void(* OverrideVersionPrinter )()=0
static VersionPrinter VersionPrinterInstance
static cl::opt< VersionPrinter,
true, parser< bool > > 
VersOp ("version", cl::desc("Display the version of this program"), cl::location(VersionPrinterInstance), cl::ValueDisallowed)


Detailed Description

ExpandResponseFiles - Copy the contents of argv into newArgv, substituting the contents of the response files for the arguments of type

Definition in file CommandLine.cpp.


Function Documentation

static bool EatsUnboundedNumberOfValues ( const Option *  O  )  [static]

static void ExpandResponseFiles ( int  argc,
char **  argv,
std::vector< char * > &  newArgv 
) [static]

static void GetOptionInfo ( std::vector< Option * > &  PositionalOpts,
std::vector< Option * > &  SinkOpts,
std::map< std::string, Option * > &  OptionsMap 
) [static]

GetOptionInfo - Scan the list of registered options, turning them into data structures that are easier to handle.

Definition at line 105 of file CommandLine.cpp.

References llvm::cerr(), llvm::cl::ConsumeAfter, llvm::cl::Option::getNextRegisteredOption(), llvm::cl::Positional, ProgramName, and llvm::cl::Sink.

Referenced by llvm::cl::ParseCommandLineOptions().

static Option* getOptionPred ( std::string  Name,
size_t &  Length,
bool(*)(const Option *)  Pred,
std::map< std::string, Option * > &  OptionsMap 
) [static]

Definition at line 260 of file CommandLine.cpp.

References Pred.

Referenced by llvm::cl::ParseCommandLineOptions().

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

static HelpPrinter HiddenPrinter ( true   )  [static]

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

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

static Option* LookupOption ( const char *&  Arg,
const char *&  Value,
std::map< std::string, Option * > &  OptionsMap 
) [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 152 of file CommandLine.cpp.

Referenced by llvm::cl::ParseCommandLineOptions().

static HelpPrinter NormalPrinter ( false   )  [static]

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

Referenced by ExpandResponseFiles(), and llvm::cl::ParseEnvironmentOptions().

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

Definition at line 925 of file CommandLine.cpp.

References llvm::cl::Option::error().

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

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

static bool RequiresValue ( const Option *  O  )  [static]

TEMPLATE_INSTANTIATION ( class opt< bool >   ) 

TEMPLATE_INSTANTIATION ( class opt< std::string >   ) 

TEMPLATE_INSTANTIATION ( class opt< int >   ) 

TEMPLATE_INSTANTIATION ( class opt< unsigned >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< std::string >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< float >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< double >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< unsigned >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< int >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< boolOrDefault >   ) 

TEMPLATE_INSTANTIATION ( class basic_parser< bool >   ) 


Variable Documentation

const Option* EmptyArg

Definition at line 1019 of file CommandLine.cpp.

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]

size_t MaxArgLen

Definition at line 1018 of file CommandLine.cpp.

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

Definition at line 72 of file CommandLine.cpp.

bool OptionListChanged = false [static]

void(* OverrideVersionPrinter)()=0 [static]

char ProgramName[80] = "<premain>" [static]

const char* ProgramOverview = 0 [static]

Definition at line 69 of file CommandLine.cpp.

Referenced by llvm::cl::ParseCommandLineOptions().

RegisteredOptionList - This is the list of the command line options that have statically constructed themselves.

Definition at line 88 of file CommandLine.cpp.

const bool ShowHidden

Definition at line 1020 of file CommandLine.cpp.

VersionPrinter VersionPrinterInstance [static]

Definition at line 1159 of file CommandLine.cpp.

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