about summary refs log tree commit diff homepage
path: root/tools
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2023-06-23 22:34:12 +0100
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2023-07-21 10:00:02 +0100
commit7082eafd05b4f268132ab94772c0243dbebf5087 (patch)
tree549f66608f0cb4e50cee2e51c53206e798ab82cd /tools
parent974f140d79a621785b1fe4a0fc7fe321ba1089e2 (diff)
downloadklee-7082eafd05b4f268132ab94772c0243dbebf5087.tar.gz
Add code to only keep in the --help menu the KLEE/Kleaver option categories
Diffstat (limited to 'tools')
-rw-r--r--tools/kleaver/main.cpp6
-rw-r--r--tools/klee/main.cpp23
2 files changed, 12 insertions, 17 deletions
diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp
index 51298dfb..42ca0c55 100644
--- a/tools/kleaver/main.cpp
+++ b/tools/kleaver/main.cpp
@@ -382,11 +382,7 @@ static bool printInputAsSMTLIBv2(const char *Filename,
 }
 
 int main(int argc, char **argv) {
-#if LLVM_VERSION_CODE >= LLVM_VERSION(13, 0)
-  KCommandLine::HideOptions(llvm::cl::getGeneralCategory());
-#else
-  KCommandLine::HideOptions(llvm::cl::GeneralCategory);
-#endif
+  KCommandLine::KeepOnlyCategories({&ExprCat, &SolvingCat});
 
   bool success = true;
 
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 483397c1..a3062d24 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -9,18 +9,18 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "klee/ADT/KTest.h"
 #include "klee/ADT/TreeStream.h"
 #include "klee/Config/Version.h"
 #include "klee/Core/Interpreter.h"
 #include "klee/Expr/Expr.h"
-#include "klee/ADT/KTest.h"
-#include "klee/Support/OptionCategories.h"
-#include "klee/Statistics/Statistics.h"
 #include "klee/Solver/SolverCmdLine.h"
+#include "klee/Statistics/Statistics.h"
 #include "klee/Support/Debug.h"
 #include "klee/Support/ErrorHandling.h"
 #include "klee/Support/FileHandling.h"
 #include "klee/Support/ModuleUtil.h"
+#include "klee/Support/OptionCategories.h"
 #include "klee/Support/PrintVersion.h"
 #include "klee/System/Time.h"
 
@@ -44,15 +44,15 @@ DISABLE_WARNING_DEPRECATED_DECLARATIONS
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
 
-#include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
 DISABLE_WARNING_POP
 
 #include <dirent.h>
 #include <signal.h>
-#include <unistd.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 #include <cerrno>
 #include <ctime>
@@ -61,7 +61,6 @@ DISABLE_WARNING_POP
 #include <iterator>
 #include <sstream>
 
-
 using namespace llvm;
 using namespace klee;
 
@@ -1118,13 +1117,13 @@ linkWithUclibc(StringRef libDir, std::string opt_suffix,
 }
 
 int main(int argc, char **argv, char **envp) {
-  atexit(llvm_shutdown);  // Call llvm_shutdown() on exit.
+  atexit(llvm_shutdown); // Call llvm_shutdown() on exit
 
-#if LLVM_VERSION_CODE >= LLVM_VERSION(13, 0)
-  KCommandLine::HideOptions(llvm::cl::getGeneralCategory());
-#else
-  KCommandLine::HideOptions(llvm::cl::GeneralCategory);
-#endif
+  KCommandLine::KeepOnlyCategories(
+     {&ChecksCat,      &DebugCat,    &ExtCallsCat, &ExprCat,   &LinkCat,
+      &MemoryCat,      &MergeCat,    &MiscCat,     &ModuleCat, &ReplayCat,
+      &SearchCat,      &SeedingCat,  &SolvingCat,  &StartCat,  &StatsCat,
+      &TerminationCat, &TestCaseCat, &TestGenCat});
 
   llvm::InitializeNativeTarget();