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/Core/ImpliedValue.cpp | 1 - lib/Expr/Expr.cpp | 3 --- lib/Solver/FastCexSolver.cpp | 8 +++++--- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'lib') 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 #include 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 @@ -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