diff options
author | Daniel Schemmel <daniel@schemmel.net> | 2023-03-23 16:49:08 +0000 |
---|---|---|
committer | Frank Busse <f.busse@imperial.ac.uk> | 2023-04-01 14:01:06 +0100 |
commit | a46b8059ba5f8b5759813d142018478d4b72db71 (patch) | |
tree | fb9ed09e21203ad39d795beb88af2015dc7501f2 /lib/Solver | |
parent | 2aa5b7b83da9d3036c5b90df7be0a1e6a49d058f (diff) | |
download | klee-a46b8059ba5f8b5759813d142018478d4b72db71.tar.gz |
remove include/klee/Support/IntEvaluation.h
Diffstat (limited to 'lib/Solver')
-rw-r--r-- | lib/Solver/FastCexSolver.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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(); } } }; |