LLVM API Documentation
#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>
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) |
Definition in file CommandLine.cpp.
| static bool EatsUnboundedNumberOfValues | ( | const Option * | O | ) | [static] |
Definition at line 292 of file CommandLine.cpp.
References llvm::cl::Option::getNumOccurrencesFlag(), llvm::cl::OneOrMore, and llvm::cl::ZeroOrMore.
Referenced by llvm::cl::ParseCommandLineOptions().
| static void ExpandResponseFiles | ( | int | argc, | |
| char ** | argv, | |||
| std::vector< char * > & | newArgv | |||
| ) | [static] |
Definition at line 379 of file CommandLine.cpp.
References llvm::sys::Path::c_str(), llvm::MemoryBuffer::getFile(), llvm::sys::PathWithStatus::getFileStatus(), llvm::sys::FileStatus::getSize(), and ParseCStringVector().
Referenced by llvm::cl::ParseCommandLineOptions().
| 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] |
Definition at line 806 of file CommandLine.cpp.
References llvm::cl::Option::ValueStr.
Referenced by llvm::cl::basic_parser_impl::getOptionWidth(), and llvm::cl::basic_parser_impl::printOptionInfo().
| static HelpPrinter HiddenPrinter | ( | true | ) | [static] |
| static bool isGrouping | ( | const Option * | O | ) | [inline, static] |
Definition at line 247 of file CommandLine.cpp.
References llvm::cl::Option::getFormattingFlag(), and llvm::cl::Grouping.
Referenced by isPrefixedOrGrouping(), and llvm::cl::ParseCommandLineOptions().
| static bool isPrefixedOrGrouping | ( | const Option * | O | ) | [inline, static] |
Definition at line 250 of file CommandLine.cpp.
References llvm::cl::Option::getFormattingFlag(), isGrouping(), and llvm::cl::Prefix.
Referenced by llvm::cl::ParseCommandLineOptions().
| 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] |
Referenced by llvm::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 303 of file CommandLine.cpp.
Referenced by ExpandResponseFiles(), and llvm::cl::ParseEnvironmentOptions().
| static bool parseDouble | ( | Option & | O, | |
| const std::string & | Arg, | |||
| double & | Value | |||
| ) | [static] |
| static bool ProvideOption | ( | Option * | Handler, | |
| const char * | ArgName, | |||
| const char * | Value, | |||
| int | argc, | |||
| char ** | argv, | |||
| int & | i | |||
| ) | [inline, static] |
Definition at line 172 of file CommandLine.cpp.
References llvm::cl::Option::addOccurrence(), llvm::cerr(), llvm::cl::Option::error(), llvm::cl::Option::getNumAdditionalVals(), llvm::cl::Option::getValueExpectedFlag(), ProgramName, llvm::cl::ValueDisallowed, llvm::cl::ValueOptional, and llvm::cl::ValueRequired.
Referenced by llvm::cl::ParseCommandLineOptions(), and ProvidePositionalOption().
| static bool ProvidePositionalOption | ( | Option * | Handler, | |
| const std::string & | Arg, | |||
| int | i | |||
| ) | [static] |
Definition at line 239 of file CommandLine.cpp.
References llvm::cl::Option::ArgStr, llvm::PIC16ISD::Dummy, and ProvideOption().
Referenced by llvm::cl::ParseCommandLineOptions().
| static bool RequiresValue | ( | const Option * | O | ) | [static] |
Definition at line 287 of file CommandLine.cpp.
References llvm::cl::Option::getNumOccurrencesFlag(), llvm::cl::OneOrMore, and llvm::cl::Required.
Referenced by llvm::cl::ParseCommandLineOptions().
| TEMPLATE_INSTANTIATION | ( | class opt< bool > | ) |
| TEMPLATE_INSTANTIATION | ( | class opt< std::string > | ) |
| TEMPLATE_INSTANTIATION | ( | class opt< int > | ) |
| 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 > | ) |
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] |
Definition at line 79 of file CommandLine.cpp.
Referenced by llvm::cl::MarkOptionsChanged(), and llvm::cl::ParseCommandLineOptions().
void(* OverrideVersionPrinter)()=0 [static] |
Referenced by llvm::cl::SetVersionPrinter().
char ProgramName[80] = "<premain>" [static] |
Definition at line 68 of file CommandLine.cpp.
Referenced by llvm::cl::Option::error(), GetOptionInfo(), llvm::cl::ParseCommandLineOptions(), and ProvideOption().
const char* ProgramOverview = 0 [static] |
Option* RegisteredOptionList = 0 [static] |
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] |