void ExprSMTLIBPrinter::scan(const ref<Expr> &e) { if (e.isNull()) { std::cerr << "ExprSMTLIBPrinter::scan() : Found NULL expression!" << std::endl; return; } if (isa<ConstantExpr>(e)) return; // we don't need to scan simple constants if (const ReadExpr *re = dyn_cast<ReadExpr>(e)) { // Attempt to insert array and if array wasn't present before do more things if (usedArrays.insert(re->updates.root).second) { // check if the array is constant if (re->updates.root->isConstantArray()) haveConstantArray = true; // scan the update list scanUpdates(re->updates.head); } } // recurse into the children Expr *ep = e.get(); for (unsigned int i = 0; i < ep->getNumKids(); i++) scan(ep->getKid(i)); }
void ExprSMTLIBLetPrinter::scan(const ref<Expr> &e) { if (isa<ConstantExpr>(e)) return; // we don't need to scan simple constants if (firstEO.insert(e).second) { // We've not seen this expression before if (const ReadExpr *re = dyn_cast<ReadExpr>(e)) { // Attempt to insert array and if array wasn't present before do more // things if (usedArrays.insert(re->updates.root).second) { // check if the array is constant if (re->updates.root->isConstantArray()) haveConstantArray = true; // scan the update list scanUpdates(re->updates.head); } } // recurse into the children Expr *ep = e.get(); for (unsigned int i = 0; i < ep->getNumKids(); i++) scan(ep->getKid(i)); } else { /* We must of seen the expression before. Add it to * the set of twoOrMoreOccurances. We don't need to * check if the insertion fails. */ twoOrMoreEO.insert(e); } }
bool QueryResultsNode::event(QEvent *e) { switch (static_cast<ModelEvent::Type>(e->type())) { case ModelEvent::UpdateFiles: { e->accept(); scanUpdates(static_cast<BaseTask::Event*>(e)); return true; } case ModelEvent::ScanFilesForRemove: { e->accept(); scanForRemove(static_cast<BaseTask::Event*>(e)); return true; } case ModelEvent::RemoveFiles: { e->accept(); performRemove(static_cast<BaseTask::Event*>(e)); return true; } default: break; } return TasksNode::event(e); }