diff options
Diffstat (limited to 'lib/Core/ImpliedValue.cpp')
| -rw-r--r-- | lib/Core/ImpliedValue.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/Core/ImpliedValue.cpp b/lib/Core/ImpliedValue.cpp index a09e4b7c..4baec512 100644 --- a/lib/Core/ImpliedValue.cpp +++ b/lib/Core/ImpliedValue.cpp @@ -193,14 +193,12 @@ void ImpliedValue::checkForImpliedValues(Solver *S, ref<Expr> e, getImpliedValues(e, value, results); - for (ImpliedValueList::iterator i = results.begin(), ie = results.end(); - i != ie; ++i) { - std::map<ref<ReadExpr>, ref<ConstantExpr> >::iterator it = - found.find(i->first); + for (auto &i : results) { + auto it = found.find(i.first); if (it != found.end()) { - assert(it->second == i->second && "Invalid ImpliedValue!"); + assert(it->second == i.second && "Invalid ImpliedValue!"); } else { - found.insert(std::make_pair(i->first, i->second)); + found.insert(std::make_pair(i.first, i.second)); } } @@ -208,7 +206,7 @@ void ImpliedValue::checkForImpliedValues(Solver *S, ref<Expr> e, std::set< ref<ReadExpr> > readsSet(reads.begin(), reads.end()); reads = std::vector< ref<ReadExpr> >(readsSet.begin(), readsSet.end()); - std::vector<ref<Expr> > assumption; + ConstraintSet assumption; assumption.push_back(EqExpr::create(e, value)); // obscure... we need to make sure that all the read indices are @@ -225,16 +223,15 @@ void ImpliedValue::checkForImpliedValues(Solver *S, ref<Expr> e, Context::get().getPointerWidth()))); } - ConstraintManager assume(assumption); - for (std::vector< ref<ReadExpr> >::iterator i = reads.begin(), - ie = reads.end(); i != ie; ++i) { - ref<ReadExpr> var = *i; + for (const auto &var : reads) { ref<ConstantExpr> possible; - bool success = S->getValue(Query(assume, var), possible); (void) success; + bool success = S->getValue(Query(assumption, var), possible); + (void)success; assert(success && "FIXME: Unhandled solver failure"); std::map<ref<ReadExpr>, ref<ConstantExpr> >::iterator it = found.find(var); bool res; - success = S->mustBeTrue(Query(assume, EqExpr::create(var, possible)), res); + success = + S->mustBeTrue(Query(assumption, EqExpr::create(var, possible)), res); assert(success && "FIXME: Unhandled solver failure"); if (res) { if (it != found.end()) { |
