From a46b8059ba5f8b5759813d142018478d4b72db71 Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Thu, 23 Mar 2023 16:49:08 +0000 Subject: remove include/klee/Support/IntEvaluation.h --- lib/Solver/FastCexSolver.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/Solver') 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 @@ -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(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(); } } }; -- cgit 1.4.1