本文整理汇总了C++中ConstantExpr::isFalse方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstantExpr::isFalse方法的具体用法?C++ ConstantExpr::isFalse怎么用?C++ ConstantExpr::isFalse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstantExpr
的用法示例。
在下文中一共展示了ConstantExpr::isFalse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
// Breaks down a constraint into all of it's individual pieces, returning a
// list of IndependentElementSets or the independent factors.
//
// Caller takes ownership of returned std::list.
static std::list<IndependentElementSet>*
getAllIndependentConstraintsSets(const Query &query) {
std::list<IndependentElementSet> *factors = new std::list<IndependentElementSet>();
ConstantExpr *CE = dyn_cast<ConstantExpr>(query.expr);
if (CE) {
assert(CE && CE->isFalse() && "the expr should always be false and "
"therefore not included in factors");
} else {
ref<Expr> neg = Expr::createIsZero(query.expr);
factors->push_back(IndependentElementSet(neg));
}
for (ConstraintManager::const_iterator it = query.constraints.begin(),
ie = query.constraints.end();
it != ie; ++it) {
// iterate through all the previously separated constraints. Until we
// actually return, factors is treated as a queue of expressions to be
// evaluated. If the queue property isn't maintained, then the exprs
// could be returned in an order different from how they came it, negatively
// affecting later stages.
factors->push_back(IndependentElementSet(*it));
}
bool doneLoop = false;
do {
doneLoop = true;
std::list<IndependentElementSet> *done =
new std::list<IndependentElementSet>;
while (factors->size() > 0) {
IndependentElementSet current = factors->front();
factors->pop_front();
// This list represents the set of factors that are separate from current.
// Those that are not inserted into this list (queue) intersect with
// current.
std::list<IndependentElementSet> *keep =
new std::list<IndependentElementSet>;
while (factors->size() > 0) {
IndependentElementSet compare = factors->front();
factors->pop_front();
if (current.intersects(compare)) {
if (current.add(compare)) {
// Means that we have added (z=y)added to (x=y)
// Now need to see if there are any (z=?)'s
doneLoop = false;
}
} else {
keep->push_back(compare);
}
}
done->push_back(current);
delete factors;
factors = keep;
}
delete factors;
factors = done;
} while (!doneLoop);
return factors;
}