Lines Matching refs:Option
1 //===--- OptTable.cpp - Option Table Implementation -----------------------===//
13 #include "clang/Driver/Option.h"
26 // version should come first; a Flag option should precede a Joined
27 // option, for example.
59 assert(((A.Kind == Option::JoinedClass) ^ (B.Kind == Option::JoinedClass)) &&
61 return B.Kind == Option::JoinedClass;
64 // Support lower_bound between info and an option name.
76 OptSpecifier::OptSpecifier(const Option *Opt) : ID(Opt->getID()) {}
82 Options(new Option*[NumOptionInfos]),
92 if (Kind == Option::InputClass) {
95 } else if (Kind == Option::UnknownClass) {
98 } else if (Kind != Option::GroupClass) {
106 // Check that everything after the first searchable option is a
107 // regular option class.
109 Option::OptionClass Kind = (Option::OptionClass) getInfo(i + 1).Kind;
110 assert((Kind != Option::InputClass && Kind != Option::UnknownClass &&
111 Kind != Option::GroupClass) &&
132 Option *OptTable::CreateOption(unsigned id) const {
136 const Option *Alias = getOption(info.AliasID);
138 Option *Opt = 0;
140 case Option::InputClass:
142 case Option::UnknownClass:
144 case Option::GroupClass:
146 case Option::FlagClass:
148 case Option::JoinedClass:
150 case Option::SeparateClass:
152 case Option::CommaJoinedClass:
154 case Option::MultiArgClass:
156 case Option::JoinedOrSeparateClass:
158 case Option::JoinedAndSeparateClass:
173 assert((info.Kind == Option::JoinedOrSeparateClass ||
174 info.Kind == Option::SeparateClass) && "Invalid option.");
175 Opt->setRenderStyle(Option::RenderJoinedStyle);
178 assert((info.Kind == Option::JoinedOrSeparateClass ||
179 info.Kind == Option::JoinedClass) && "Invalid option.");
180 Opt->setRenderStyle(Option::RenderSeparateStyle);
199 // Search for the first next option which could be a prefix.
204 // prefix it, we iteratively search for the next option which could
211 // Scan for first option which is a proper prefix.
218 // See if this option matches.
271 case Option::GroupClass: case Option::InputClass: case Option::UnknownClass:
272 llvm_unreachable("Invalid option with help text.");
274 case Option::MultiArgClass:
275 llvm_unreachable("Cannot print metavar for this kind of option.");
277 case Option::FlagClass:
280 case Option::SeparateClass: case Option::JoinedOrSeparateClass:
283 case Option::JoinedClass: case Option::CommaJoinedClass:
284 case Option::JoinedAndSeparateClass:
300 // Find the maximum option length.
315 const std::string &Option = OptionHelp[i].first;
316 int Pad = OptionFieldWidth - int(Option.size());
317 OS.indent(InitialPad) << Option;
319 // Break on long option names.
335 // Abuse the help text of the option groups to store the "help group"
338 // FIXME: Split out option groups.
353 // Render help text into a map of group-name to a list of (option, help)
362 // FIXME: Split out option groups.
363 if (getOptionKind(Id) == Option::GroupClass)