Lines Matching refs:Sub
126 for (const auto &Sub : RegisteredSubCommands) { in addLiteralOption() local
127 if (SC == Sub) in addLiteralOption()
129 addLiteralOption(Opt, Sub, Name); in addLiteralOption()
177 for (const auto &Sub : RegisteredSubCommands) { in addOption() local
178 if (SC == Sub) in addOption()
180 addOption(O, Sub); in addOption()
200 SubCommand &Sub = *SC; in removeOption() local
202 Sub.OptionsMap.erase(Name); in removeOption()
205 for (auto Opt = Sub.PositionalOpts.begin(); in removeOption()
206 Opt != Sub.PositionalOpts.end(); ++Opt) { in removeOption()
208 Sub.PositionalOpts.erase(Opt); in removeOption()
213 for (auto Opt = Sub.SinkOpts.begin(); Opt != Sub.SinkOpts.end(); ++Opt) { in removeOption()
215 Sub.SinkOpts.erase(Opt); in removeOption()
219 else if (O == Sub.ConsumeAfterOpt) in removeOption()
220 Sub.ConsumeAfterOpt = nullptr; in removeOption()
237 bool hasOptions(const SubCommand &Sub) const { in hasOptions()
238 return (!Sub.OptionsMap.empty() || !Sub.PositionalOpts.empty() || in hasOptions()
239 nullptr != Sub.ConsumeAfterOpt); in hasOptions()
253 SubCommand &Sub = *SC; in updateArgStr() local
254 if (!Sub.OptionsMap.insert(std::make_pair(NewName, O)).second) { in updateArgStr()
259 Sub.OptionsMap.erase(O->ArgStr); in updateArgStr()
285 [sub](const SubCommand *Sub) { in registerSubCommand() argument
287 (Sub->getName() == sub->getName()); in registerSubCommand()
330 Option *LookupOption(SubCommand &Sub, StringRef &Arg, StringRef &Value);
399 Option *CommandLineParser::LookupOption(SubCommand &Sub, StringRef &Arg, in LookupOption() argument
404 assert(&Sub != &*AllSubCommands); in LookupOption()
411 auto I = Sub.OptionsMap.find(Arg); in LookupOption()
412 if (I == Sub.OptionsMap.end()) in LookupOption()
415 return I != Sub.OptionsMap.end() ? I->second : nullptr; in LookupOption()
420 auto I = Sub.OptionsMap.find(Arg.substr(0, EqualPos)); in LookupOption()
421 if (I == Sub.OptionsMap.end()) in LookupOption()
1754 SubCommand *Sub = GlobalParser->getActiveSubCommand(); in operator =() local
1755 auto &OptionsMap = Sub->OptionsMap; in operator =()
1756 auto &PositionalOpts = Sub->PositionalOpts; in operator =()
1757 auto &ConsumeAfterOpt = Sub->ConsumeAfterOpt; in operator =()
1768 if (Sub == &*TopLevelSubCommand) in operator =()
1772 if (Sub->getDescription() != nullptr) { in operator =()
1773 outs() << "SUBCOMMAND '" << Sub->getName() in operator =()
1774 << "': " << Sub->getDescription() << "\n\n"; in operator =()
1776 outs() << "USAGE: " << GlobalParser->ProgramName << " " << Sub->getName() in operator =()
1790 if (Sub == &*TopLevelSubCommand && Subs.size() > 2) { in operator =()
2118 StringMap<Option *> &cl::getRegisteredOptions(SubCommand &Sub) { in getRegisteredOptions() argument
2121 assert(std::find(Subs.begin(), Subs.end(), &Sub) != Subs.end()); in getRegisteredOptions()
2122 return Sub.OptionsMap; in getRegisteredOptions()
2125 void cl::HideUnrelatedOptions(cl::OptionCategory &Category, SubCommand &Sub) { in HideUnrelatedOptions() argument
2126 for (auto &I : Sub.OptionsMap) { in HideUnrelatedOptions()
2134 SubCommand &Sub) { in HideUnrelatedOptions() argument
2137 for (auto &I : Sub.OptionsMap) { in HideUnrelatedOptions()