virtual void printQuery(const Query& query, const Query* falseQuery = 0, const std::vector<const Array*>* objects = 0) { const ref<Expr>* evalExprsBegin = 0; const ref<Expr>* evalExprsEnd = 0; if (0 != falseQuery) { evalExprsBegin = &query.expr; evalExprsEnd = &query.expr + 1; } const Array* const *evalArraysBegin = 0; const Array* const *evalArraysEnd = 0; if ((0 != objects) && (false == objects->empty())) { evalArraysBegin = &((*objects)[0]); evalArraysEnd = &((*objects)[0]) + objects->size(); } const Query* q = (0 == falseQuery) ? &query : falseQuery; printer->printQuery(logBuffer, q->constraints, q->expr, evalExprsBegin, evalExprsEnd, evalArraysBegin, evalArraysEnd); }
void PTree::dump(llvm::raw_ostream &os) { ExprPPrinter *pp = ExprPPrinter::create(os); pp->setNewline("\\l"); os << "digraph G {\n"; os << "\tsize=\"10,7.5\";\n"; os << "\tratio=fill;\n"; os << "\trotate=90;\n"; os << "\tcenter = \"true\";\n"; os << "\tnode [style=\"filled\",width=.1,height=.1,fontname=\"Terminus\"]\n"; os << "\tedge [arrowsize=.3]\n"; std::vector<PTree::Node*> stack; stack.push_back(root); while (!stack.empty()) { PTree::Node *n = stack.back(); stack.pop_back(); if (n->condition.isNull()) { os << "\tn" << n << " [label=\"\""; } else { os << "\tn" << n << " [label=\""; pp->print(n->condition); os << "\",shape=diamond"; } if (n->data) os << ",fillcolor=green"; os << "];\n"; if (n->left) { os << "\tn" << n << " -> n" << n->left << ";\n"; stack.push_back(n->left); } if (n->right) { os << "\tn" << n << " -> n" << n->right << ";\n"; stack.push_back(n->right); } } os << "}\n"; delete pp; }
void startQuery(const Query& query, const char *typeName, const ref<Expr> *evalExprsBegin = 0, const ref<Expr> *evalExprsEnd = 0, const Array * const* evalArraysBegin = 0, const Array * const* evalArraysEnd = 0) { Statistic *S = theStatisticManager->getStatisticByName("Instructions"); uint64_t instructions = S ? S->getValue() : 0; os << "# Query " << queryCount++ << " -- " << "Type: " << typeName << ", " << "Instructions: " << instructions << "\n"; printer->printQuery(os, query.constraints, query.expr, evalExprsBegin, evalExprsEnd, evalArraysBegin, evalArraysEnd); startTime = getWallTime(); }