about summary refs log tree commit diff homepage
path: root/lib/Expr
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2021-12-15 16:20:29 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2022-03-17 22:59:26 +0000
commitd8553f3cec042b5af9e21c268cb14ee8f7b30083 (patch)
treed8545f09d6ae508df5a8d19ad30b6dbd6f1e4182 /lib/Expr
parent8cab09eb98d06d488e036ceec9f4b16090502297 (diff)
downloadklee-d8553f3cec042b5af9e21c268cb14ee8f7b30083.tar.gz
remove LLVM < 6 from sources
Diffstat (limited to 'lib/Expr')
-rw-r--r--lib/Expr/AssignmentGenerator.cpp4
-rw-r--r--lib/Expr/Expr.cpp12
2 files changed, 5 insertions, 11 deletions
diff --git a/lib/Expr/AssignmentGenerator.cpp b/lib/Expr/AssignmentGenerator.cpp
index be77765e..5ec7c511 100644
--- a/lib/Expr/AssignmentGenerator.cpp
+++ b/lib/Expr/AssignmentGenerator.cpp
@@ -332,11 +332,7 @@ AssignmentGenerator::getIndexedValue(const std::vector<unsigned char> &c_val,
                                      const unsigned int size) {
   std::vector<unsigned char> toReturn;
   const llvm::APInt index_val = index.getAPValue();
-#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
   assert(!index_val.isSignMask() && "Negative index");
-#else
-  assert(!index_val.isSignBit() && "Negative index");
-#endif
   const uint64_t id = index_val.getZExtValue() / c_val.size();
   uint64_t arraySize = size / c_val.size();
   for (uint64_t i = 0; i < arraySize; ++i) {
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 2b9eab0d..50020fb1 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -343,13 +343,11 @@ ref<Expr> ConstantExpr::fromMemory(void *address, Width width) {
   case Expr::Int64: return ConstantExpr::create(*((uint64_t*) address), width);
   // FIXME: what about machines without x87 support?
   default:
-    return ConstantExpr::alloc(llvm::APInt(width,
-#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
-      (width+llvm::APFloatBase::integerPartWidth-1)/llvm::APFloatBase::integerPartWidth,
-#else
-      (width+llvm::integerPartWidth-1)/llvm::integerPartWidth,
-#endif
-      (const uint64_t*)address));
+    return ConstantExpr::alloc(
+        llvm::APInt(width,
+                    (width + llvm::APFloatBase::integerPartWidth - 1) /
+                        llvm::APFloatBase::integerPartWidth,
+                    (const uint64_t *)address));
   }
 }