about summary refs log tree commit diff homepage
path: root/lib/Solver/FastCexSolver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-04 08:31:20 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-04 08:31:20 +0000
commitf870aa1e0723e9203df495020ee2bf2bc47a6246 (patch)
treed15a78c7c6f4106ce141fc92c8dce5dc8217bd84 /lib/Solver/FastCexSolver.cpp
parent44e3d58b59099f5fd0e6f88893ce431171b3fef6 (diff)
downloadklee-f870aa1e0723e9203df495020ee2bf2bc47a6246.tar.gz
Finish removing uses of Expr::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Solver/FastCexSolver.cpp')
-rw-r--r--lib/Solver/FastCexSolver.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/Solver/FastCexSolver.cpp b/lib/Solver/FastCexSolver.cpp
index a0d943d3..1a1cfe62 100644
--- a/lib/Solver/FastCexSolver.cpp
+++ b/lib/Solver/FastCexSolver.cpp
@@ -416,16 +416,17 @@ public:
 
       // XXX we need to respect the version here and object state chain
 
-      if (re->index->isConstant() && 
-          re->index->getConstantValue() < array->size) {
-        CexValueData &cvd = cod.values[re->index->getConstantValue()];
-        CexValueData tmp = cvd.set_intersection(range);
+      if (ConstantExpr *CE = dyn_cast<ConstantExpr>(re->index)) {
+        if (CE->getConstantValue() < array->size) {
+          CexValueData &cvd = cod.values[CE->getConstantValue()];
+          CexValueData tmp = cvd.set_intersection(range);
         
-        if (tmp.isEmpty()) {
-          if (range.isFixed()) // ranges conflict, if new one is fixed use that
-            cvd = range;
-        } else {
-          cvd = tmp;
+          if (tmp.isEmpty()) {
+            if (range.isFixed()) // ranges conflict, if new one is fixed use that
+              cvd = range;
+          } else {
+            cvd = tmp;
+          }
         }
       } else {
         // XXX        fatal("XXX not implemented");
@@ -613,8 +614,8 @@ public:
     case Expr::Eq: {
       BinaryExpr *be = cast<BinaryExpr>(e);
       if (range.isFixed()) {
-        if (be->left->isConstant()) {
-          uint64_t value = be->left->getConstantValue();
+        if (ConstantExpr *CE = dyn_cast<ConstantExpr>(be->left)) {
+          uint64_t value = CE->getConstantValue();
           if (range.min()) {
             forceExprToValue(be->right, value);
           } else {
@@ -939,8 +940,8 @@ FastCexSolver::computeInitialValues(const Query& query,
                                   ConstantExpr::create(i,
                                                        kMachinePointerType)));
       
-      if (value->isConstant()) {
-        data.push_back(value->getConstantValue());
+      if (ConstantExpr *CE = dyn_cast<ConstantExpr>(value)) {
+        data.push_back(CE->getConstantValue());
       } else {
         // FIXME: When does this happen?
         return false;