From 92004d6524c7633aa1e014e5b727a39475652dda Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 4 Jun 2009 08:59:53 +0000 Subject: Sink getConstantValue into ConstantExpr. - Propogate ConstantExpr to various places, or cast as appropriate. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72862 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Core/ImpliedValue.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Core/ImpliedValue.cpp') diff --git a/lib/Core/ImpliedValue.cpp b/lib/Core/ImpliedValue.cpp index 6ad0f5d2..e1daca2f 100644 --- a/lib/Core/ImpliedValue.cpp +++ b/lib/Core/ImpliedValue.cpp @@ -30,7 +30,8 @@ static void _getImpliedValue(ref e, ImpliedValueList &results) { switch (e->getKind()) { case Expr::Constant: { - assert(value == e->getConstantValue() && "error in implied value calculation"); + assert(value == cast(e)->getConstantValue() && + "error in implied value calculation"); break; } @@ -203,14 +204,15 @@ void ImpliedValue::getImpliedValues(ref e, void ImpliedValue::checkForImpliedValues(Solver *S, ref e, ref value) { std::vector > reads; - std::map, ref > found; + std::map, ref > found; ImpliedValueList results; getImpliedValues(e, value, results); for (ImpliedValueList::iterator i = results.begin(), ie = results.end(); i != ie; ++i) { - std::map, ref >::iterator it = found.find(i->first); + std::map, ref >::iterator it = + found.find(i->first); if (it != found.end()) { assert(it->second->getConstantValue() == i->second->getConstantValue() && "I don't think so Scott"); @@ -247,7 +249,7 @@ void ImpliedValue::checkForImpliedValues(Solver *S, ref e, ref possible; bool success = S->getValue(Query(assume, var), possible); assert(success && "FIXME: Unhandled solver failure"); - std::map, ref >::iterator it = found.find(var); + std::map, ref >::iterator it = found.find(var); bool res; success = S->mustBeTrue(Query(assume, EqExpr::create(var, possible)), res); assert(success && "FIXME: Unhandled solver failure"); -- cgit 1.4.1