about summary refs log tree commit diff homepage
path: root/lib/Core/ImpliedValue.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-04 08:59:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-04 08:59:53 +0000
commit92004d6524c7633aa1e014e5b727a39475652dda (patch)
treee68a45e3aa57b34a33f5f1dfbb496acb8bcebc9a /lib/Core/ImpliedValue.cpp
parent21fb3bd80309b30ed2223e793003ac4744776dfb (diff)
downloadklee-92004d6524c7633aa1e014e5b727a39475652dda.tar.gz
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
Diffstat (limited to 'lib/Core/ImpliedValue.cpp')
-rw-r--r--lib/Core/ImpliedValue.cpp10
1 files changed, 6 insertions, 4 deletions
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<Expr> e,
                              ImpliedValueList &results) {
   switch (e->getKind()) {
   case Expr::Constant: {
-    assert(value == e->getConstantValue() && "error in implied value calculation");
+    assert(value == cast<ConstantExpr>(e)->getConstantValue() && 
+           "error in implied value calculation");
     break;
   }
 
@@ -203,14 +204,15 @@ void ImpliedValue::getImpliedValues(ref<Expr> e,
 void ImpliedValue::checkForImpliedValues(Solver *S, ref<Expr> e, 
                                          ref<ConstantExpr> value) {
   std::vector<ref<ReadExpr> > reads;
-  std::map<ref<ReadExpr>, ref<Expr> > found;
+  std::map<ref<ReadExpr>, ref<ConstantExpr> > found;
   ImpliedValueList results;
 
   getImpliedValues(e, value, results);
 
   for (ImpliedValueList::iterator i = results.begin(), ie = results.end();
        i != ie; ++i) {
-    std::map<ref<ReadExpr>, ref<Expr> >::iterator it = found.find(i->first);
+    std::map<ref<ReadExpr>, ref<ConstantExpr> >::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<Expr> e,
     ref<ConstantExpr> possible;
     bool success = S->getValue(Query(assume, var), possible);
     assert(success && "FIXME: Unhandled solver failure");    
-    std::map<ref<ReadExpr>, ref<Expr> >::iterator it = found.find(var);
+    std::map<ref<ReadExpr>, ref<ConstantExpr> >::iterator it = found.find(var);
     bool res;
     success = S->mustBeTrue(Query(assume, EqExpr::create(var, possible)), res);
     assert(success && "FIXME: Unhandled solver failure");