Lines Matching refs:Arg
175 static Option *LookupOption(StringRef &Arg, StringRef &Value,
178 if (Arg.empty()) return 0;
180 size_t EqualPos = Arg.find('=');
185 StringMap<Option*>::const_iterator I = OptionsMap.find(Arg);
190 // return Arg unmolested.
192 OptionsMap.find(Arg.substr(0, EqualPos));
195 Value = Arg.substr(EqualPos+1);
196 Arg = Arg.substr(0, EqualPos);
204 static Option *LookupNearestOption(StringRef Arg,
208 if (Arg.empty()) return 0;
211 std::pair<StringRef, StringRef> SplitArg = Arg.split('=');
212 StringRef &LHS = SplitArg.first; // LHS == Arg when no '=' is present.
227 StringRef Flag = PermitValue ? LHS : Arg;
310 // If this isn't a multi-arg option, just run the handler.
337 static bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i) {
339 return ProvideOption(Handler, Handler->ArgStr, Arg, 0, 0, Dummy);
380 /// see if this is a prefix or grouped option. If so, split arg into output an
381 /// Arg/Value pair and return the Option to parse it with.
382 static Option *HandlePrefixedOrGroupedOption(StringRef &Arg, StringRef &Value,
385 if (Arg.size() == 1) return 0;
389 Option *PGOpt = getOptionPred(Arg, Length, isPrefixedOrGrouping, OptionsMap);
396 Value = Arg.substr(Length);
397 Arg = Arg.substr(0, Length);
398 assert(OptionsMap.count(Arg) && OptionsMap.find(Arg)->second == PGOpt);
407 // Move current arg name out of Arg into OneArgName.
408 StringRef OneArgName = Arg.substr(0, Length);
409 Arg = Arg.substr(Length);
420 PGOpt = getOptionPred(Arg, Length, isGrouping, OptionsMap);
421 } while (PGOpt && Length != Arg.size());
423 // Return the last option with Arg cut down to just the last one.
638 const char *Arg = Argv[I];
639 if (Arg[0] != '@') {
654 if (!ExpandResponseFile(Arg + 1, Saver, Tokenizer, ExpandedArgv)) {
1136 StringRef Arg, bool &Value) {
1137 if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" ||
1138 Arg == "1") {
1143 if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") {
1147 return O.error("'" + Arg +
1154 StringRef Arg, boolOrDefault &Value) {
1155 if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" ||
1156 Arg == "1") {
1160 if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") {
1165 return O.error("'" + Arg +
1172 StringRef Arg, int &Value) {
1173 if (Arg.getAsInteger(0, Value))
1174 return O.error("'" + Arg + "' value invalid for integer argument!");
1181 StringRef Arg, unsigned &Value) {
1183 if (Arg.getAsInteger(0, Value))
1184 return O.error("'" + Arg + "' value invalid for uint argument!");
1191 StringRef Arg, unsigned long long &Value){
1193 if (Arg.getAsInteger(0, Value))
1194 return O.error("'" + Arg + "' value invalid for uint argument!");
1200 static bool parseDouble(Option &O, StringRef Arg, double &Value) {
1201 SmallString<32> TmpStr(Arg.begin(), Arg.end());
1206 return O.error("'" + Arg + "' value invalid for floating point argument!");
1211 StringRef Arg, double &Val) {
1212 return parseDouble(O, Arg, Val);
1216 StringRef Arg, float &Val) {
1218 if (parseDouble(O, Arg, dVal))