diff options
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; |