From d8553f3cec042b5af9e21c268cb14ee8f7b30083 Mon Sep 17 00:00:00 2001 From: Frank Busse Date: Wed, 15 Dec 2021 16:20:29 +0000 Subject: remove LLVM < 6 from sources --- lib/Expr/AssignmentGenerator.cpp | 4 ---- lib/Expr/Expr.cpp | 12 +++++------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'lib/Expr') 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 &c_val, const unsigned int size) { std::vector 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 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)); } } -- cgit 1.4.1