[llvm] r229170 - NFC. More code cleanup making LookupOption a member of the CommandLineParser.
Chris Bieneman
beanz at apple.com
Fri Feb 13 14:54:27 PST 2015
Author: cbieneman
Date: Fri Feb 13 16:54:27 2015
New Revision: 229170
URL: http://llvm.org/viewvc/llvm-project?rev=229170&view=rev
Log:
NFC. More code cleanup making LookupOption a member of the CommandLineParser.
Modified:
llvm/trunk/lib/Support/CommandLine.cpp
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=229170&r1=229169&r2=229170&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Fri Feb 13 16:54:27 2015
@@ -190,6 +190,9 @@ public:
}
void printOptionValues();
+
+private:
+ Option *LookupOption(StringRef &Arg, StringRef &Value);
};
} // namespace
@@ -242,8 +245,7 @@ void OptionCategory::registerCategory()
/// 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. This assumes that leading dashes have already been stripped.
-static Option *LookupOption(StringRef &Arg, StringRef &Value,
- const StringMap<Option *> &OptionsMap) {
+Option *CommandLineParser::LookupOption(StringRef &Arg, StringRef &Value) {
// Reject all dashes.
if (Arg.empty())
return nullptr;
@@ -953,7 +955,7 @@ void CommandLineParser::ParseCommandLine
while (!ArgName.empty() && ArgName[0] == '-')
ArgName = ArgName.substr(1);
- Handler = LookupOption(ArgName, Value, OptionsMap);
+ Handler = LookupOption(ArgName, Value);
if (!Handler || Handler->getFormattingFlag() != cl::Positional) {
ProvidePositionalOption(ActivePositionalArg, argv[i], i);
continue; // We are done!
@@ -965,7 +967,7 @@ void CommandLineParser::ParseCommandLine
while (!ArgName.empty() && ArgName[0] == '-')
ArgName = ArgName.substr(1);
- Handler = LookupOption(ArgName, Value, OptionsMap);
+ Handler = LookupOption(ArgName, Value);
// Check to see if this "option" is really a prefixed or grouped argument.
if (!Handler)
More information about the llvm-commits
mailing list