Home | History | Annotate | Download | only in Support

Lines Matching defs:Option

36 /// cl Namespace - This namespace contains all of the command line option
42 // ParseCommandLineOptions - Command line option processing entry point.
48 // ParseEnvironmentOptions - Environment variable option processing alternate
70 // PrintOptionValues - Print option values.
71 // With -print-options print the difference between option values and defaults.
72 // With -print-all-options print all option values.
77 class Option;
79 /// \brief Adds a new option for parsing and provides the option it refers to.
81 /// \param O pointer to the option
82 /// \param Name the string name for the option to handle during parsing
84 /// Literal options are used by some parsers to register special option values.
86 void AddLiteralOption(Option &O, const char *Name);
98 // ConsumeAfter - Indicates that this option is fed anything that follows the
100 // there are zero positional arguments, and a ConsumeAfter option is used).
103 // passed, unprocessed, to the ConsumeAfter option.
108 enum ValueExpected { // Is a value required for the option?
115 enum OptionHidden { // Control whether -help shows this option
116 NotHidden = 0x00, // Option included in -help & -help-hidden
121 // Formatting flags - This controls special features that the option might have
124 // Prefix - This option allows arguments that are otherwise unrecognized to be
131 // Grouping - With this option enabled, multiple letter options are allowed to
139 Prefix = 0x02, // Can this option directly prefix its value?
140 Grouping = 0x03 // Can this option group with other options?
150 // Option Category class
168 // The general Option Category (used as default category).
172 // Option Base class
175 class Option {
202 unsigned Position; // Position of last occurrence of the option
203 unsigned AdditionalVals; // Greater than 0 for multi-valued option.
208 const char *ValueStr; // String describing what the value of this option is
209 OptionCategory *Category; // The Category this option belongs to
246 explicit Option(enum NumOccurrencesFlag OccurrencesFlag,
260 /// Unregisters this option from the CommandLine system.
262 /// This option must have been the last option registered.
266 // Return the width of the option tag for printing...
269 // printOptionInfo - Print out information about this option. The
283 // Prints option name followed by message. Always returns true.
288 virtual ~Option() {}
292 // Command line option modifiers that can be used to modify the behavior of
293 // command line option parsers...
300 void apply(Option &O) const { O.setDescription(Desc); }
308 void apply(Option &O) const { O.setValueStr(Desc); }
328 // want to store it in the option itself.
341 // cat - Specifiy the Option category for the command line argument to belong
369 // The default value safely does nothing. Option value printing is only
393 // Simple copy of the option value.
409 assert(Valid && "invalid option value");
429 // Non-class option values.
441 // Top-level option
455 // Other safe-to-copy-by-value common option types.
491 // Enum valued command line option
498 // as the values that go into the mapping that the option handler uses. Note
505 // inserted so we can print our option out nicely.
564 generic_parser_base(Option &O) : Owner(O) {}
573 // getOption - Return option name N.
579 // Return the width of the option tag for printing...
580 virtual size_t getOptionWidth(const Option &O) const;
584 // printOptionInfo - Print out information about this option. The
587 virtual void printOptionInfo(const Option &O, size_t GlobalWidth) const;
589 void printGenericOptionDiff(const Option &O, const GenericOptionValue &V,
593 // printOptionDiff - print the value of an option and it's default.
595 // Template definition ensures that the option and default have the same
598 void printOptionDiff(const Option &O, const AnyOptionValue &V,
608 // argument for every possible option. This ensures that our options are
633 // findOption - Return the option number corresponding to the specified
634 // argument string. If the option is not found, getNumOptions() is returned.
639 Option &Owner;
645 // command line option for -help. Because this is a simple mapping parser, the
659 parser(Option &O) : generic_parser_base(O) {}
669 // getOptionValue - Return the value of option name N.
675 bool parse(Option &O, StringRef ArgName, StringRef Arg, DataType &V) {
688 return O.error("Cannot find option named '" + ArgVal + "'!");
695 assert(findOption(Name) == Values.size() && "Option already exists!");
701 /// removeLiteralOption - Remove the specified option.
705 assert(N != Values.size() && "Option not found!");
715 basic_parser_impl(Option &O) {}
726 // Return the width of the option tag for printing...
727 size_t getOptionWidth(const Option &O) const;
729 // printOptionInfo - Print out information about this option. The
732 void printOptionInfo(const Option &O, size_t GlobalWidth) const;
736 void printOptionNoValue(const Option &O, size_t GlobalWidth) const;
747 void printOptionName(const Option &O, size_t GlobalWidth) const;
755 basic_parser(Option &O) : basic_parser_impl(O) {}
769 parser(Option &O) : basic_parser(O) {}
772 bool parse(Option &O, StringRef ArgName, StringRef Arg, bool &Val);
783 void printOptionDiff(const Option &O, bool V, OptVal Default,
797 parser(Option &O) : basic_parser(O) {}
800 bool parse(Option &O, StringRef ArgName, StringRef Arg, boolOrDefault &Val);
809 void printOptionDiff(const Option &O, boolOrDefault V, OptVal Default,
823 parser(Option &O) : basic_parser(O) {}
826 bool parse(Option &O, StringRef ArgName, StringRef Arg, int &Val);
831 void printOptionDiff(const Option &O, int V, OptVal Default,
845 parser(Option &O) : basic_parser(O) {}
848 bool parse(Option &O, StringRef ArgName, StringRef Arg, unsigned &Val);
853 void printOptionDiff(const Option &O, unsigned V, OptVal Default,
869 parser(Option &O) : basic_parser(O) {}
872 bool parse(Option &O, StringRef ArgName, StringRef Arg,
878 void printOptionDiff(const Option &O, unsigned long long V, OptVal Default,
892 parser(Option &O) : basic_parser(O) {}
895 bool parse(Option &O, StringRef ArgName, StringRef Arg, double &Val);
900 void printOptionDiff(const Option &O, double V, OptVal Default,
914 parser(Option &O) : basic_parser(O) {}
917 bool parse(Option &O, StringRef ArgName, StringRef Arg, float &Val);
922 void printOptionDiff(const Option &O, float V, OptVal Default,
936 parser(Option &O) : basic_parser(O) {}
939 bool parse(Option &, StringRef, StringRef Arg, std::string &Value) {
947 void printOptionDiff(const Option &O, StringRef V, OptVal Default,
961 parser(Option &O) : basic_parser(O) {}
964 bool parse(Option &, StringRef, StringRef Arg, char &Value) {
972 void printOptionDiff(const Option &O, char V, OptVal Default,
989 void printOptionDiff(const Option &O, const generic_parser_base &P, const DT &V,
996 // type than the option value. e.g. HelpPrinter.
998 void print(const Option &O, const parser<ParserDT> &P, const ValDT & /*V*/,
1005 // type as the option value.
1007 void print(const Option &O, const parser<DT> &P, const DT &V,
1014 // different type than the option type.
1017 const Option &O,
1054 static void opt(NumOccurrencesFlag N, Option &O) {
1059 static void opt(ValueExpected VE, Option &O) { O.setValueExpectedFlag(VE); }
1062 static void opt(OptionHidden OH, Option &O) { O.setHiddenFlag(OH); }
1065 static void opt(FormattingFlags FF, Option &O) { O.setFormattingFlag(FF); }
1068 static void opt(MiscFlags MF, Option &O) { O.setMiscFlag(MF); }
1071 // apply method - Apply modifiers to an option in a type safe way.
1096 "line option with external storage, "
1103 bool setLocation(Option &O, DataType &L) {
1183 // opt - A scalar command line option.
1187 class opt : public Option,
1248 : Option(Optional, NotHidden), Parser(*this) {
1273 bool setLocation(Option &O, StorageClass &L) {
1282 "line option with external storage!");
1304 class list : public Option, public list_storage<DataType, Storage> {
1353 assert(optnum < this->size() && "Invalid option index");
1357 void setNumAdditionalVals(unsigned n) { Option::setNumAdditionalVals(n); }
1361 : Option(ZeroOrMore, NotHidden), Parser(*this) {
1398 bool setLocation(Option &O, unsigned &L) {
1407 "line option with external storage!");
1444 Option, public bits_storage<DataType, Storage> {
1493 assert(optnum < this->size() && "Invalid option index");
1499 : Option(ZeroOrMore, NotHidden), Parser(*this) {
1506 // Aliased command line option (alias this name to a preexisting name)
1509 class alias : public Option {
1510 Option *AliasFor;
1535 error("cl::alias must have an cl::aliasopt(option) specified!");
1544 void setAliasFor(Option &O) {
1552 : Option(Optional, Hidden), AliasFor(nullptr) {
1558 // aliasfor - Modifier to set the option an alias aliases.
1560 Option &Opt;
1561 explicit aliasopt(Option &O) : Opt(O) {}
1577 /// -help or -help-hidden option had been given on the command line.
1600 /// StringMap<llvm::cl::Option*> &opts = llvm::cl::getRegisteredOptions();
1616 StringMap<Option *> &getRegisteredOptions();
1693 /// option category to display in the -help output.
1702 /// option category to display in the -help output.