about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2019-03-11 16:27:39 +0000
committerMartinNowack <martin.nowack@gmail.com>2019-03-13 22:10:53 +0000
commitc1209fba3edd49ece755d29179231de468729a2b (patch)
tree7df4ca82b8d9e98ca6b7aeb865d6df466fd64877 /lib
parent891a3842d164ef4392c3f51431b6a8443092fc86 (diff)
downloadklee-c1209fba3edd49ece755d29179231de468729a2b.tar.gz
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.
Diffstat (limited to 'lib')
-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