diff options
author | Chris Bieneman <beanz@apple.com> | 2015-02-13 22:54:27 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-02-13 22:54:27 +0000 |
commit | 542f56a51292c0822044a38bfbf3d35681a6c631 (patch) | |
tree | 259a8d4e0d999e1a56e0d57869579da64e727d9d /llvm/lib/Support/CommandLine.cpp | |
parent | fcd3d87ad8800cf594fd04408e1a6d87f3426e94 (diff) | |
download | bcm5719-llvm-542f56a51292c0822044a38bfbf3d35681a6c631.tar.gz bcm5719-llvm-542f56a51292c0822044a38bfbf3d35681a6c631.zip |
NFC. More code cleanup making LookupOption a member of the CommandLineParser.
llvm-svn: 229170
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 7d9f3b7930a..9a1e8831064 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -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::ParseCommandLineOptions(int argc, 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::ParseCommandLineOptions(int argc, 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) |