about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/ImpliedValue.cpp1
-rw-r--r--lib/Expr/Expr.cpp3
-rw-r--r--lib/Solver/FastCexSolver.cpp8
3 files changed, 5 insertions, 7 deletions
diff --git a/lib/Core/ImpliedValue.cpp b/lib/Core/ImpliedValue.cpp
index 6e5a52dc..4128a2dc 100644
--- a/lib/Core/ImpliedValue.cpp
+++ b/lib/Core/ImpliedValue.cpp
@@ -15,7 +15,6 @@
 #include "klee/Expr/Expr.h"
 #include "klee/Expr/ExprUtil.h"
 #include "klee/Solver/Solver.h"
-#include "klee/Support/IntEvaluation.h" // FIXME: Use APInt
 
 #include <map>
 #include <set>
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index d82cbee3..2d3670d8 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -12,9 +12,6 @@
 #include "klee/Config/Version.h"
 #include "klee/Expr/ExprPPrinter.h"
 #include "klee/Support/OptionCategories.h"
-// FIXME: We shouldn't need this once fast constant support moves into
-// Core. If we need to do arithmetic, we probably want to use APInt.
-#include "klee/Support/IntEvaluation.h"
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Hashing.h"
diff --git a/lib/Solver/FastCexSolver.cpp b/lib/Solver/FastCexSolver.cpp
index 382774ce..34a44c3e 100644
--- a/lib/Solver/FastCexSolver.cpp
+++ b/lib/Solver/FastCexSolver.cpp
@@ -17,8 +17,8 @@
 #include "klee/Expr/ExprVisitor.h"
 #include "klee/Solver/IncompleteSolver.h"
 #include "klee/Support/Debug.h"
-#include "klee/Support/IntEvaluation.h" // FIXME: Use APInt
 
+#include "llvm/ADT/APInt.h"
 #include "llvm/Support/raw_ostream.h"
 
 #include <cassert>
@@ -260,6 +260,7 @@ public:
   }
   
   std::int64_t minSigned(unsigned bits) const {
+    assert(bits >= 2 && bits <= 64);
     assert((m_min >> bits) == 0 && (m_max >> bits) == 0 &&
            "range is outside given number of bits");
 
@@ -269,13 +270,14 @@ public:
 
     std::uint64_t smallest = (static_cast<std::uint64_t>(1) << (bits - 1));
     if (m_max >= smallest) {
-      return ints::sext(smallest, 64, bits);
+      return llvm::APInt::getSignedMinValue(bits).getSExtValue();
     } else {
       return m_min;
     }
   }
 
   std::int64_t maxSigned(unsigned bits) const {
+    assert(bits >= 2 && bits <= 64);
     assert((m_min >> bits) == 0 && (m_max >> bits) == 0 &&
            "range is outside given number of bits");
 
@@ -288,7 +290,7 @@ public:
     if (m_min < smallest && m_max >= smallest) {
       return smallest - 1;
     } else {
-      return ints::sext(m_max, 64, bits);
+      return llvm::APInt(bits, m_max, true).getSExtValue();
     }
   }
 };