From c1209fba3edd49ece755d29179231de468729a2b Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Mon, 11 Mar 2019 16:27:39 +0000 Subject: Added function to hide all options in a given category. Removed uneeded (and incorrectly-implemented) function for hiding all options unrelated to a set of categories. --- lib/Basic/CmdLineOptions.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'lib/Basic') diff --git a/lib/Basic/CmdLineOptions.cpp b/lib/Basic/CmdLineOptions.cpp index 05ee2821..80dc3c9d 100644 --- a/lib/Basic/CmdLineOptions.cpp +++ b/lib/Basic/CmdLineOptions.cpp @@ -112,6 +112,22 @@ cl::opt UseAssignmentValidatingSolver( cl::desc("Debug the correctness of generated assignments (default=false)"), cl::cat(SolvingCat)); + +void KCommandLine::HideOptions(llvm::cl::OptionCategory &Category) { +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) + StringMap &map = cl::getRegisteredOptions(); +#else + StringMap map; + cl::getRegisteredOptions(map); +#endif + + for (auto &elem : map) { + if (elem.second->Category == &Category) { + elem.second->setHiddenFlag(cl::Hidden); + } + } +} + void KCommandLine::HideUnrelatedOptions(cl::OptionCategory &Category) { #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) StringMap &map = cl::getRegisteredOptions(); @@ -127,14 +143,6 @@ void KCommandLine::HideUnrelatedOptions(cl::OptionCategory &Category) { } } -void KCommandLine::HideUnrelatedOptions( - ArrayRef Categories) { - for (ArrayRef::iterator i = Categories.begin(), - e = Categories.end(); - i != e; i++) - HideUnrelatedOptions(*i); -} - #ifdef ENABLE_METASMT #ifdef METASMT_DEFAULT_BACKEND_IS_BTOR -- cgit 1.4.1