From 974f140d79a621785b1fe4a0fc7fe321ba1089e2 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 7 Jul 2023 23:55:47 +0100 Subject: Move some options to the klee namespace and declare them in OptionCategories.h --- lib/Core/MemoryManager.cpp | 2 -- lib/Core/StatsTracker.cpp | 4 ++-- lib/Core/UserSearcher.cpp | 11 +++++------ 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/Core/MemoryManager.cpp b/lib/Core/MemoryManager.cpp index bdb89bb5..a6c3cb25 100644 --- a/lib/Core/MemoryManager.cpp +++ b/lib/Core/MemoryManager.cpp @@ -43,9 +43,7 @@ std::uint32_t MemoryManager::quarantine; std::size_t MemoryManager::pageSize = sysconf(_SC_PAGE_SIZE); bool MemoryManager::isDeterministic; -} // namespace klee -namespace { llvm::cl::OptionCategory MemoryCat("Memory management options", "These options control memory management."); diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp index 305c6da2..6cb14cf3 100644 --- a/lib/Core/StatsTracker.cpp +++ b/lib/Core/StatsTracker.cpp @@ -54,7 +54,7 @@ using namespace llvm; /// -namespace { +namespace klee { cl::OptionCategory StatsCat("Statistics options", "These options control the statistics generated by KLEE."); @@ -116,7 +116,7 @@ cl::opt UseCallPaths("use-call-paths", cl::init(true), "level statistics (default=true)"), cl::cat(StatsCat)); -} // namespace +} // namespace klee /// diff --git a/lib/Core/UserSearcher.cpp b/lib/Core/UserSearcher.cpp index 398c44a9..19ac3718 100644 --- a/lib/Core/UserSearcher.cpp +++ b/lib/Core/UserSearcher.cpp @@ -20,7 +20,7 @@ using namespace llvm; using namespace klee; -namespace { +namespace klee { llvm::cl::OptionCategory SearchCat("Search options", "These options control the search heuristic."); @@ -79,12 +79,10 @@ cl::opt BatchTime( cl::init("5s"), cl::cat(SearchCat)); -} // namespace - -void klee::initializeSearchOptions() { +void initializeSearchOptions() { // default values if (CoreSearch.empty()) { - if (UseMerge){ + if (UseMerge) { CoreSearch.push_back(Searcher::NURS_CovNew); klee_warning("--use-merge enabled. Using NURS_CovNew as default searcher."); } else { @@ -94,7 +92,7 @@ void klee::initializeSearchOptions() { } } -bool klee::userSearcherRequiresMD2U() { +bool userSearcherRequiresMD2U() { return (std::find(CoreSearch.begin(), CoreSearch.end(), Searcher::NURS_MD2U) != CoreSearch.end() || std::find(CoreSearch.begin(), CoreSearch.end(), Searcher::NURS_CovNew) != CoreSearch.end() || std::find(CoreSearch.begin(), CoreSearch.end(), Searcher::NURS_ICnt) != CoreSearch.end() || @@ -102,6 +100,7 @@ bool klee::userSearcherRequiresMD2U() { std::find(CoreSearch.begin(), CoreSearch.end(), Searcher::NURS_QC) != CoreSearch.end()); } +} // namespace klee Searcher *getNewSearcher(Searcher::CoreSearchType type, RNG &rng, PTree &processTree) { Searcher *searcher = nullptr; -- cgit 1.4.1