diff options
author | Chris Bieneman <beanz@apple.com> | 2015-01-30 22:16:01 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-01-30 22:16:01 +0000 |
commit | d77bbab393005193fc36153793f65d1279c5b316 (patch) | |
tree | ca38e2143af7b731db843aa69dee7bfb9231af3d /llvm/lib/Support/CommandLine.cpp | |
parent | 964f4dbaae604b222f18cfeec8f222c712a7731a (diff) | |
download | bcm5719-llvm-d77bbab393005193fc36153793f65d1279c5b316.tar.gz bcm5719-llvm-d77bbab393005193fc36153793f65d1279c5b316.zip |
NFC. Making printOptionValues an API on the parser class.
llvm-svn: 227626
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 5cda94bae27..c8578cb6513 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -178,7 +178,7 @@ public: nullptr != ConsumeAfterOpt); } - void updateArgStr(Option *O, const char* NewName) { + void updateArgStr(Option *O, const char *NewName) { if (!OptionsMap.insert(std::make_pair(NewName, O)).second) { errs() << ProgramName << ": CommandLine Error: Option '" << O->ArgStr << "' registered more than once!\n"; @@ -186,6 +186,8 @@ public: } OptionsMap.erase(StringRef(O->ArgStr)); } + + void printOptionValues(); }; static ManagedStatic<CommandLineParser> GlobalParser; @@ -1725,12 +1727,14 @@ void HelpPrinterWrapper::operator=(bool Value) { } // Print the value of each option. -void cl::PrintOptionValues() { +void cl::PrintOptionValues() { GlobalParser->printOptionValues(); } + +void CommandLineParser::printOptionValues() { if (!PrintOptions && !PrintAllOptions) return; SmallVector<std::pair<const char *, Option *>, 128> Opts; - sortOpts(GlobalParser->OptionsMap, Opts, /*ShowHidden*/ true); + sortOpts(OptionsMap, Opts, /*ShowHidden*/ true); // Compute the maximum argument length... size_t MaxArgLen = 0; |