From 45a194b06a98fe781a5547df174df50bd9ed9132 Mon Sep 17 00:00:00 2001 From: Sebastian Poeplau Date: Wed, 26 Aug 2020 10:29:35 +0200 Subject: Guard process-tree compression with a command-line switch --- lib/Core/PTree.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Core/PTree.cpp b/lib/Core/PTree.cpp index 4d2931cb..af5dbc36 100644 --- a/lib/Core/PTree.cpp +++ b/lib/Core/PTree.cpp @@ -13,11 +13,23 @@ #include "klee/Expr/Expr.h" #include "klee/Expr/ExprPPrinter.h" +#include "klee/Support/OptionCategories.h" #include #include using namespace klee; +using namespace llvm; + +namespace { + +cl::opt + CompressProcessTree("compress-process-tree", + cl::desc("Remove intermediate nodes in the process " + "tree whenever possible (default=false)"), + cl::init(false), cl::cat(MiscCat)); + +} // namespace PTree::PTree(ExecutionState *initialState) : root(PTreeNodePtr(new PTreeNode(nullptr, initialState))) { @@ -55,7 +67,7 @@ void PTree::remove(PTreeNode *n) { n = p; } while (n && !n->left.getPointer() && !n->right.getPointer()); - if (n) { + if (n && CompressProcessTree) { // We're now at a node that has exactly one child; we've just deleted the // other one. Eliminate the node and connect its child to the parent // directly (if it's not the root). -- cgit 1.4.1