27 CompressProcessTree(
"compress-process-tree",
28 cl::desc(
"Remove intermediate nodes in the process "
29 "tree whenever possible (default=false)"),
30 cl::init(
false), cl::cat(
MiscCat));
41 assert(node && !node->
left.getPointer() && !node->
right.getPointer());
43 "Attach assumes the right state is the current state");
44 node->
state =
nullptr;
47 uint8_t currentNodeTag =
root.getInt();
49 currentNodeTag = node->
parent->
left.getPointer() == node
56 assert(!n->
left.getPointer() && !n->
right.getPointer());
60 if (n == p->
left.getPointer()) {
63 assert(n == p->
right.getPointer());
69 }
while (n && !n->
left.getPointer() && !n->
right.getPointer());
71 if (n && CompressProcessTree) {
78 child.getPointer()->
parent = parent;
83 if (n == parent->
left.getPointer()) {
86 assert(n == parent->
right.getPointer());
87 parent->
right = child;
98 os <<
"digraph G {\n";
99 os <<
"\tsize=\"10,7.5\";\n";
100 os <<
"\tratio=fill;\n";
101 os <<
"\trotate=90;\n";
102 os <<
"\tcenter = \"true\";\n";
103 os <<
"\tnode [style=\"filled\",width=.1,height=.1,fontname=\"Terminus\"]\n";
104 os <<
"\tedge [arrowsize=.3]\n";
105 std::vector<const PTreeNode*> stack;
106 stack.push_back(
root.getPointer());
107 while (!stack.empty()) {
110 os <<
"\tn" << n <<
" [shape=diamond";
112 os <<
",fillcolor=green";
114 if (n->
left.getPointer()) {
115 os <<
"\tn" << n <<
" -> n" << n->
left.getPointer();
117 << std::bitset<PtrBitCount>(n->
left.getInt()).to_string() <<
"];\n";
118 stack.push_back(n->
left.getPointer());
120 if (n->
right.getPointer()) {
121 os <<
"\tn" << n <<
" -> n" << n->
right.getPointer();
123 << std::bitset<PtrBitCount>(n->
right.getInt()).to_string() <<
"];\n";
124 stack.push_back(n->
right.getPointer());
BranchType
Reason an ExecutionState forked.
ExecutionState representing a path under exploration.
PTreeNode * ptreeNode
Pointer to the process tree of the current state Copies of ExecutionState should not copy ptreeNode.
static ExprPPrinter * create(llvm::raw_ostream &os)
virtual void setNewline(const std::string &newline)=0
PTreeNode(const PTreeNode &)=delete
void attach(PTreeNode *node, ExecutionState *leftState, ExecutionState *rightState, BranchType reason)
void dump(llvm::raw_ostream &os)
void remove(PTreeNode *node)
llvm::PointerIntPair< PTreeNode *, PtrBitCount, uint8_t > PTreeNodePtr
llvm::cl::OptionCategory MiscCat