about summary refs log tree commit diff homepage
path: root/lib/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Basic')
-rw-r--r--lib/Basic/CmdLineOptions.cpp24
1 files changed, 16 insertions, 8 deletions
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<bool> 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<cl::Option *> &map = cl::getRegisteredOptions();
+#else
+  StringMap<cl::Option *> 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<cl::Option *> &map = cl::getRegisteredOptions();
@@ -127,14 +143,6 @@ void KCommandLine::HideUnrelatedOptions(cl::OptionCategory &Category) {
   }
 }
 
-void KCommandLine::HideUnrelatedOptions(
-    ArrayRef<const cl::OptionCategory *> Categories) {
-  for (ArrayRef<const cl::OptionCategory *>::iterator i = Categories.begin(),
-                                                      e = Categories.end();
-       i != e; i++)
-    HideUnrelatedOptions(*i);
-}
-
 #ifdef ENABLE_METASMT
 
 #ifdef METASMT_DEFAULT_BACKEND_IS_BTOR