From 49f2e54339e186fd68cf6cb3ab775d0e3f643eb8 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 11 Aug 2017 20:13:17 +0100 Subject: Added support for hiding command-line options --- lib/Basic/CmdLineOptions.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'lib/Basic') diff --git a/lib/Basic/CmdLineOptions.cpp b/lib/Basic/CmdLineOptions.cpp index 324f349e..da333884 100644 --- a/lib/Basic/CmdLineOptions.cpp +++ b/lib/Basic/CmdLineOptions.cpp @@ -15,6 +15,12 @@ #include "klee/CommandLine.h" #include "klee/Config/Version.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/Support/CommandLine.h" + +using namespace llvm; + namespace klee { llvm::cl::opt @@ -81,6 +87,25 @@ llvm::cl::opt UseAssignmentValidatingSolver("debug-assignment-validating-solver", llvm::cl::init(false)); +void KCommandLine::HideUnrelatedOptions(cl::OptionCategory &Category) { + StringMap map; + cl::getRegisteredOptions(map); + for (StringMap::iterator i = map.begin(), e = map.end(); i != e; + i++) { + if (i->second->Category != &Category) { + i->second->setHiddenFlag(cl::Hidden); + } + } +} + +void KCommandLine::HideUnrelatedOptions( + llvm::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 @@ -156,7 +181,3 @@ llvm::cl::opt DebugCrossCheckCoreSolverWith( #undef METASMT_IS_DEFAULT_STR #undef Z3_IS_DEFAULT_STR #undef DEFAULT_CORE_SOLVER - - - - -- cgit 1.4.1