Jiri Slaby 2023-03-22 08:46:28 +00:00 committed by Git OBS Bridge
parent 8a422213b0
commit b24e610338
11 changed files with 290 additions and 342 deletions

View File

@ -1,65 +0,0 @@
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Sat, 5 Mar 2022 13:48:35 +0100
Subject: Module/InstructionOperandTypeCheckPass: Fix
-Wbitwise-instead-of-logical warning
Git-repo: https://github.com/lzaoral/klee#llvm14
Git-commit: fc8c581aac41a1b8df23a5f47d70ac2296be7ffc
Patch-mainline: no
References: llvm 14
This warning was introduced in Clang 14.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
lib/Module/InstructionOperandTypeCheckPass.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/Module/InstructionOperandTypeCheckPass.cpp b/lib/Module/InstructionOperandTypeCheckPass.cpp
index 5f428471..e67f051c 100644
--- a/lib/Module/InstructionOperandTypeCheckPass.cpp
+++ b/lib/Module/InstructionOperandTypeCheckPass.cpp
@@ -94,7 +94,7 @@ bool checkInstruction(const Instruction *i) {
// scalarizer pass might not remove these. This could be selecting which
// vector operand to feed to another instruction. The Executor can handle
// this so case so this is not a problem
- return checkOperandTypeIsScalarInt(i, 0) &
+ return checkOperandTypeIsScalarInt(i, 0) &&
checkOperandsHaveSameType(i, 1, 2);
}
// Integer arithmetic, logical and shifting
@@ -111,12 +111,12 @@ bool checkInstruction(const Instruction *i) {
case Instruction::Shl:
case Instruction::LShr:
case Instruction::AShr: {
- return checkOperandTypeIsScalarInt(i, 0) &
+ return checkOperandTypeIsScalarInt(i, 0) &&
checkOperandTypeIsScalarInt(i, 1);
}
// Integer comparison
case Instruction::ICmp: {
- return checkOperandTypeIsScalarIntOrPointer(i, 0) &
+ return checkOperandTypeIsScalarIntOrPointer(i, 0) &&
checkOperandTypeIsScalarIntOrPointer(i, 1);
}
// Integer Conversion
@@ -136,7 +136,7 @@ bool checkInstruction(const Instruction *i) {
case Instruction::FMul:
case Instruction::FDiv:
case Instruction::FRem: {
- return checkOperandTypeIsScalarFloat(i, 0) &
+ return checkOperandTypeIsScalarFloat(i, 0) &&
checkOperandTypeIsScalarFloat(i, 1);
}
// Floating point conversion
@@ -152,7 +152,7 @@ bool checkInstruction(const Instruction *i) {
}
// Floating point comparison
case Instruction::FCmp: {
- return checkOperandTypeIsScalarFloat(i, 0) &
+ return checkOperandTypeIsScalarFloat(i, 0) &&
checkOperandTypeIsScalarFloat(i, 1);
}
default:
--
2.35.3

View File

@ -0,0 +1,243 @@
From: Jiri Slaby <jslaby@suse.cz>
Date: Wed, 22 Mar 2023 09:36:46 +0100
Subject: [cmake] implement USE_MAP to support single LLVM library
Patch-mainline: no
References: https://github.com/klee/klee/pull/1585
Otherwise we see:
: && /var/lib/build/ccache/bin/clang++ -O2 -Wall ... test-randgen.cpp.o -o bin/ktest-randgen lib/libkleeBasic.a -lLLVMSupport && :
/usr/bin/ld: cannot find -lLLVMSupport: No such file or directory
Fixes #1581.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@gmail.com>
---
CMakeLists.txt | 8 ++++++++
lib/Basic/CMakeLists.txt | 7 ++++++-
lib/Core/CMakeLists.txt | 7 ++++++-
lib/Expr/CMakeLists.txt | 7 ++++++-
lib/Module/CMakeLists.txt | 34 +++++++++++++++++++---------------
lib/Solver/CMakeLists.txt | 7 ++++++-
lib/Support/CMakeLists.txt | 6 +++++-
test/CMakeLists.txt | 12 ++++++++++--
tools/kleaver/CMakeLists.txt | 6 +++++-
unittests/CMakeLists.txt | 6 +++++-
10 files changed, 76 insertions(+), 24 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf01df24e9df..43f7144b4562 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -727,3 +727,11 @@ add_custom_target(uninstall
COMMENT "Uninstalling..."
VERBATIM
)
+
+set(USE_MAP FALSE)
+if (TARGET LLVMSupport)
+ get_target_property(LLVMSupport_TYPE LLVMSupport TYPE)
+ if (LLVMSupport STREQUAL SHARED_LIBRARY)
+ set(USE_MAP TRUE)
+ endif()
+endif()
diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt
index 5671c1445948..d489ba9c47f6 100644
--- a/lib/Basic/CMakeLists.txt
+++ b/lib/Basic/CMakeLists.txt
@@ -11,7 +11,12 @@ add_library(kleeBasic
Statistics.cpp
)
-llvm_map_components_to_libnames(llvm_libs support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs support)
+else()
+ set(llvm_libs LLVM)
+endif()
+
target_link_libraries(kleeBasic PRIVATE ${llvm_libs})
target_compile_options(kleeBasic PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
target_compile_definitions(kleeBasic PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})
diff --git a/lib/Core/CMakeLists.txt b/lib/Core/CMakeLists.txt
index 0905a7f03e98..5467f240aed1 100644
--- a/lib/Core/CMakeLists.txt
+++ b/lib/Core/CMakeLists.txt
@@ -36,7 +36,12 @@ target_link_libraries(kleeCore PRIVATE
kleeSupport
)
-llvm_map_components_to_libnames(llvm_libs core executionengine mcjit native support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs core executionengine mcjit native support)
+else()
+ set(llvm_libs LLVM)
+endif()
+
target_link_libraries(kleeCore PRIVATE ${llvm_libs} ${SQLITE3_LIBRARIES})
target_include_directories(kleeCore PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${SQLITE3_INCLUDE_DIRS})
target_compile_options(kleeCore PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
diff --git a/lib/Expr/CMakeLists.txt b/lib/Expr/CMakeLists.txt
index 6b8a873bb8ed..eed9e9b354c1 100644
--- a/lib/Expr/CMakeLists.txt
+++ b/lib/Expr/CMakeLists.txt
@@ -26,7 +26,12 @@ add_library(kleaverExpr
Updates.cpp
)
-llvm_map_components_to_libnames(llvm_libs support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs support)
+else()
+ set(llvm_libs LLVM)
+endif()
+
target_link_libraries(kleaverExpr PRIVATE ${llvm_libs})
target_include_directories(kleaverExpr PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS})
target_compile_options(kleaverExpr PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
diff --git a/lib/Module/CMakeLists.txt b/lib/Module/CMakeLists.txt
index c81d395e2cb8..49b51a9936c6 100644
--- a/lib/Module/CMakeLists.txt
+++ b/lib/Module/CMakeLists.txt
@@ -26,21 +26,25 @@ add_library(kleeModule
${KLEE_MODULE_COMPONENT_SRCS}
)
-llvm_map_components_to_libnames(llvm_libs bitreader
- bitwriter
- codegen
- ipo
- irreader
- linker
- support
- scalaropts
- instcombine
- transformutils
- analysis
- object
- mc
- binaryformat
- )
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs bitreader
+ bitwriter
+ codegen
+ ipo
+ irreader
+ linker
+ support
+ scalaropts
+ instcombine
+ transformutils
+ analysis
+ object
+ mc
+ binaryformat
+ )
+else()
+ set(llvm_libs LLVM)
+endif()
target_link_libraries(kleeModule PRIVATE ${llvm_libs})
diff --git a/lib/Solver/CMakeLists.txt b/lib/Solver/CMakeLists.txt
index 81a64882672c..bef0391325e5 100644
--- a/lib/Solver/CMakeLists.txt
+++ b/lib/Solver/CMakeLists.txt
@@ -32,7 +32,12 @@ add_library(kleaverSolver
Z3Solver.cpp
)
-llvm_map_components_to_libnames(llvm_libs support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs support)
+else()
+ set(llvm_libs LLVM)
+endif()
+
target_link_libraries(kleaverSolver PRIVATE
kleeBasic
kleaverExpr
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt
index 7ff4daa34e85..8e6e876dc415 100644
--- a/lib/Support/CMakeLists.txt
+++ b/lib/Support/CMakeLists.txt
@@ -18,7 +18,11 @@ add_library(kleeSupport
TreeStream.cpp
)
-llvm_map_components_to_libnames(llvm_libs support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs support)
+else()
+ set(llvm_libs LLVM)
+endif()
target_link_libraries(kleeSupport PRIVATE ${llvm_libs} ${ZLIB_LIBRARIES} ${TCMALLOC_LIBRARIES})
target_include_directories(kleeSupport PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${TCMALLOC_INCLUDE_DIR})
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 226eb08a3d1f..4c6bdfd172b9 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -96,7 +96,11 @@ if (DOWNLOAD_FILECHECK_SOURCE)
add_executable(FileCheck
${FILECHECK_SRC_FILE}
)
- llvm_map_components_to_libnames(FILECHECK_NEEDED_LIBS support)
+ if (USE_MAP)
+ llvm_map_components_to_libnames(FILECHECK_NEEDED_LIBS support)
+ else()
+ set(FILECHECK_NEEDED_LIBS LLVM)
+ endif()
target_include_directories(FileCheck PRIVATE ${LLVM_INCLUDE_DIRS})
target_link_libraries(FileCheck PRIVATE ${FILECHECK_NEEDED_LIBS})
endif()
@@ -117,7 +121,11 @@ if (DOWNLOAD_NOT_SOURCE)
add_executable("not"
${NOT_SRC_FILE}
)
- llvm_map_components_to_libnames(NOT_NEEDED_LIBS support)
+ if (USE_MAP)
+ llvm_map_components_to_libnames(NOT_NEEDED_LIBS support)
+ else()
+ set(NOT_NEEDED_LIBS LLVM)
+ endif()
target_include_directories("not" PRIVATE ${LLVM_INCLUDE_DIRS})
target_link_libraries("not" PRIVATE ${NOT_NEEDED_LIBS})
endif()
diff --git a/tools/kleaver/CMakeLists.txt b/tools/kleaver/CMakeLists.txt
index acc681e506c3..414c4d53ad10 100644
--- a/tools/kleaver/CMakeLists.txt
+++ b/tools/kleaver/CMakeLists.txt
@@ -10,7 +10,11 @@ add_executable(kleaver
main.cpp
)
-llvm_map_components_to_libnames(llvm_libs core support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(llvm_libs core support)
+else()
+ set(llvm_libs LLVM)
+endif()
target_link_libraries(kleaver kleaverSolver ${llvm_libs})
target_include_directories(kleaver PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS})
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 9e30a9b76613..e852558d930a 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -201,7 +201,11 @@ endif()
add_library(unittest_main)
target_sources(unittest_main PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/TestMain.cpp")
-llvm_map_components_to_libnames(UNITTEST_MAIN_LIBS support)
+if (USE_MAP)
+ llvm_map_components_to_libnames(UNITTEST_MAIN_LIBS support)
+else()
+ set(UNITTEST_MAIN_LIBS LLVM)
+endif()
target_link_libraries(unittest_main
PUBLIC
--
2.40.0

View File

@ -1,29 +0,0 @@
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Sat, 5 Mar 2022 13:44:24 +0100
Subject: llvm14: Add LLVM 14 to lit.cfg
Git-repo: https://github.com/lzaoral/klee#llvm14
Git-commit: 87b74ea337994d2a564bd583004ef4ae3d0bd2ce
Patch-mainline: no
References: llvm 14
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
test/lit.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/lit.cfg b/test/lit.cfg
index 4d7382cf..c935ab8e 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -161,7 +161,7 @@ config.substitutions.append(
# Add feature for the LLVM version in use, so it can be tested in REQUIRES and
# XFAIL checks. We also add "not-XXX" variants, for the same reason.
-known_llvm_versions = { "9.0", "10.0", "11.0", "11.1", "12.0", "13.0" }
+known_llvm_versions = { "9.0", "10.0", "11.0", "11.1", "12.0", "13.0", "14.0" }
current_llvm_version_tuple = (int(config.llvm_version_major), int(config.llvm_version_minor))
current_llvm_version = "%s.%s" % current_llvm_version_tuple
--
2.35.3

View File

@ -1,32 +0,0 @@
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Sat, 5 Mar 2022 14:08:11 +0100
Subject: llvm14: TargetRegistry.h was moved from Support to MC
Git-repo: https://github.com/lzaoral/klee#llvm14
Git-commit: fcbec7650d30a39bed145041c6b5e9d996185524
Patch-mainline: no
References: llvm 14
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
lib/Module/RaiseAsm.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp
index 98e580a8..457927f9 100644
--- a/lib/Module/RaiseAsm.cpp
+++ b/lib/Module/RaiseAsm.cpp
@@ -19,7 +19,11 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/Host.h"
+#if LLVM_VERSION_CODE >= LLVM_VERSION(14, 0)
+#include "llvm/MC/TargetRegistry.h"
+#else
#include "llvm/Support/TargetRegistry.h"
+#endif
#include "llvm/Target/TargetMachine.h"
--
2.35.3

View File

@ -1,203 +0,0 @@
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= <lzaoral@redhat.com>
Date: Sat, 5 Mar 2022 16:50:36 +0100
Subject: llvm14: PointerType::getElementType() was deprecated
Git-repo: https://github.com/lzaoral/klee#llvm14
Git-commit: 6caf7f74dd5aedcb39ade5f33a34673d3b6b091f
Patch-mainline: no
References: llvm 14
... for LLVM 14 in [1] and has already been removed from the LLVM 15
branch in [2].
Some changes are only temporary to silence the warning though, as
Type::getPointerElementType() is planned to be removed as well. [3]
[1] https://reviews.llvm.org/D117885/new/
[2] https://github.com/llvm/llvm-project/commit/d593cf7
[3] https://llvm.org/docs/OpaquePointers.html#migration-instructions
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/klee/Module/KCallable.h | 5 +++++
include/klee/Module/KModule.h | 4 ++++
lib/Core/Executor.cpp | 30 ++++++++++++----------------
lib/Core/Executor.h | 2 +-
lib/Core/ExternalDispatcher.cpp | 3 +--
lib/Core/GetElementPtrTypeIterator.h | 4 ++--
lib/Module/FunctionAlias.cpp | 6 ++----
7 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/include/klee/Module/KCallable.h b/include/klee/Module/KCallable.h
index bf8b17ea..e25fb5b5 100644
--- a/include/klee/Module/KCallable.h
+++ b/include/klee/Module/KCallable.h
@@ -32,6 +32,7 @@ public:
CallableKind getKind() const { return Kind; }
virtual llvm::StringRef getName() const = 0;
+ virtual llvm::FunctionType *getFunctionType() const = 0;
virtual llvm::PointerType *getType() const = 0;
virtual llvm::Value *getValue() = 0;
@@ -55,6 +56,10 @@ public:
llvm::StringRef getName() const override { return name; }
+ llvm::FunctionType *getFunctionType() const override {
+ return value->getFunctionType();
+ }
+
llvm::PointerType *getType() const override { return value->getType(); }
llvm::Value *getValue() override { return value; }
diff --git a/include/klee/Module/KModule.h b/include/klee/Module/KModule.h
index 71fe8a0a..ca6d2b22 100644
--- a/include/klee/Module/KModule.h
+++ b/include/klee/Module/KModule.h
@@ -64,6 +64,10 @@ namespace klee {
llvm::StringRef getName() const override { return function->getName(); }
+ llvm::FunctionType *getFunctionType() const override {
+ return function->getFunctionType();
+ }
+
llvm::PointerType *getType() const override { return function->getType(); }
llvm::Value *getValue() override { return function; }
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 42405982..661198e7 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -710,7 +710,7 @@ void Executor::allocateGlobalObjects(ExecutionState &state) {
for (const GlobalVariable &v : m->globals()) {
std::size_t globalObjectAlignment = getAllocationAlignment(&v);
- Type *ty = v.getType()->getElementType();
+ Type *ty = v.getValueType();
std::uint64_t size = 0;
if (ty->isSized())
size = kmodule->targetData->getTypeStoreSize(ty);
@@ -2420,10 +2420,9 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
}
if (f) {
- const FunctionType *fType =
- dyn_cast<FunctionType>(cast<PointerType>(f->getType())->getElementType());
+ const FunctionType *fType = f->getFunctionType();
const FunctionType *fpType =
- dyn_cast<FunctionType>(cast<PointerType>(fp->getType())->getElementType());
+ dyn_cast<FunctionType>(fp->getType()->getPointerElementType());
// special case the call with a bitcast case
if (fType != fpType) {
@@ -3324,13 +3323,14 @@ void Executor::updateStates(ExecutionState *current) {
removedStates.clear();
}
-template <typename SqType, typename TypeIt>
+template <typename TypeIt>
void Executor::computeOffsetsSeqTy(KGEPInstruction *kgepi,
ref<ConstantExpr> &constantOffset,
uint64_t index, const TypeIt it) {
- const auto *sq = cast<SqType>(*it);
+ assert(it->getNumContainedTypes() == 1 &&
+ "Sequential type must contain one subtype");
uint64_t elementSize =
- kmodule->targetData->getTypeStoreSize(sq->getElementType());
+ kmodule->targetData->getTypeStoreSize(it->getContainedType(0));
const Value *operand = it.getOperand();
if (const Constant *c = dyn_cast<Constant>(operand)) {
ref<ConstantExpr> index =
@@ -3355,12 +3355,9 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) {
uint64_t addend = sl->getElementOffset((unsigned) ci->getZExtValue());
constantOffset = constantOffset->Add(ConstantExpr::alloc(addend,
Context::get().getPointerWidth()));
- } else if (isa<ArrayType>(*ii)) {
- computeOffsetsSeqTy<ArrayType>(kgepi, constantOffset, index, ii);
- } else if (isa<VectorType>(*ii)) {
- computeOffsetsSeqTy<VectorType>(kgepi, constantOffset, index, ii);
- } else if (isa<PointerType>(*ii)) {
- computeOffsetsSeqTy<PointerType>(kgepi, constantOffset, index, ii);
+ } else if (isa<ArrayType>(*ii) || isa<VectorType>(*ii) ||
+ isa<PointerType>(*ii)) {
+ computeOffsetsSeqTy(kgepi, constantOffset, index, ii);
} else
assert("invalid type" && 0);
index++;
@@ -4611,10 +4608,9 @@ size_t Executor::getAllocationAlignment(const llvm::Value *allocSite) const {
alignment = GO->getAlignment();
if (const GlobalVariable *globalVar = dyn_cast<GlobalVariable>(GO)) {
// All GlobalVariables's have pointer type
- llvm::PointerType *ptrType =
- dyn_cast<llvm::PointerType>(globalVar->getType());
- assert(ptrType && "globalVar's type is not a pointer");
- type = ptrType->getElementType();
+ assert(globalVar->getType()->isPointerTy() &&
+ "globalVar's type is not a pointer");
+ type = globalVar->getValueType();
} else {
type = GO->getType();
}
diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h
index 279d8bee..4b88567a 100644
--- a/lib/Core/Executor.h
+++ b/lib/Core/Executor.h
@@ -450,7 +450,7 @@ private:
/// bindModuleConstants - Initialize the module constant table.
void bindModuleConstants();
- template <typename SqType, typename TypeIt>
+ template <typename TypeIt>
void computeOffsetsSeqTy(KGEPInstruction *kgepi,
ref<ConstantExpr> &constantOffset, uint64_t index,
const TypeIt it);
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index 7a0d8e14..d286bea9 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -284,8 +284,7 @@ Function *ExternalDispatcherImpl::createDispatcher(KCallable *target,
argI64sp->getType()->getPointerElementType(), argI64sp, "args");
// Get the target function type.
- FunctionType *FTy = cast<FunctionType>(
- cast<PointerType>(target->getType())->getElementType());
+ FunctionType *FTy = target->getFunctionType();
// Each argument will be passed by writing it into gTheArgsP[i].
unsigned i = 0, idx = 2;
diff --git a/lib/Core/GetElementPtrTypeIterator.h b/lib/Core/GetElementPtrTypeIterator.h
index 89606a0a..54fe6a29 100644
--- a/lib/Core/GetElementPtrTypeIterator.h
+++ b/lib/Core/GetElementPtrTypeIterator.h
@@ -88,8 +88,8 @@ class generic_gep_type_iterator
if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(CurTy)) {
CurTy = CT->getTypeAtIndex(getOperand());
#endif
- } else if (auto ptr = dyn_cast<llvm::PointerType>(CurTy)) {
- CurTy = ptr->getElementType();
+ } else if (llvm::isa<llvm::PointerType>(CurTy)) {
+ CurTy = CurTy->getPointerElementType();
} else {
CurTy = 0;
}
diff --git a/lib/Module/FunctionAlias.cpp b/lib/Module/FunctionAlias.cpp
index a98b74fb..aa80b35d 100644
--- a/lib/Module/FunctionAlias.cpp
+++ b/lib/Module/FunctionAlias.cpp
@@ -135,10 +135,8 @@ bool FunctionAliasPass::runOnModule(Module &M) {
const FunctionType *FunctionAliasPass::getFunctionType(const GlobalValue *gv) {
const Type *type = gv->getType();
- while (type->isPointerTy()) {
- const PointerType *ptr = cast<PointerType>(type);
- type = ptr->getElementType();
- }
+ while (type->isPointerTy())
+ type = type->getPointerElementType();
return cast<FunctionType>(type);
}
--
2.35.3

View File

@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/klee/klee</param>
<param name="changesrevision">667ce0f1ef33c32fbe2d1836fc1b334066e244ca</param></service></servicedata>
<param name="changesrevision">1398e960ec9aca3f0ceac5e37062631986b9c2a8</param></service></servicedata>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b125f1811f9709d01c21eb79825d63d2a0ad8b9c36e4e56211661a1448b80cb
size 19689485

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce262a03422d6ff4a2a61067a42b20b8936af9ac62312a87ab8dcbda36cef6ed
size 19807245

View File

@ -1,3 +1,40 @@
-------------------------------------------------------------------
Wed Mar 22 08:17:59 UTC 2023 - jslaby@suse.cz
- Update to version 2.3+20230320:
* ConstantArrayExprVisitor: Fix detection of multiple array indices
* ConstantArrayExprVisitor: Deduplicate `visitConcat` and `visitRead`
* llvm14 support
* Update KDAlloc unittests
* Don't fail `KleeStats.c` test if it takes 1s or longer
* Disable `const_array_opt1` for ubsan as well
* Fix uninitialised memory access while reading last path entry
* Fix building of runtime library and klee-replay
* Add support to disable memsan instrumentation; update UB/Asan suppression
* [MemSan] Mark memory objects modified by syscalls as initialised
* Fix compiler warning with newer compilers
* Use bitcode library paths via config generation instead of `-D` flags
* [cmake] Use LLVM's CMake functionality only
* Fixed a bug in KLEE libc's implementation of strcmp: according to the C standard, characters should be compared as unsigned chars.
* Add some system tests for KDAlloc
* Integrate KDAlloc into KLEE
* Have the STP coverage build also provide Z3, so that the crosscheck solver can also be tested
* Add a few simple solver tests
* create klee-last as a relative link
* Fix integer overflow
* Add an extra check to test/Runtime/FreeStanding/memcpy_chk_err.c ensuring that a call to __memcpy_chk is emitted
* fix output check in test const_arr_opt1
* add missing FileCheck command to test
* Fixed some leaks in klee-replay
* fix FileCheck cmd of VarArgByVal test
- remove (upstream):
* 0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch
* 0001-llvm14-Add-LLVM-14-to-lit.cfg.patch
* 0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch
* 0003-llvm14-PointerType-getElementType-was-deprecated.patch
- add
* 0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch
-------------------------------------------------------------------
Tue Oct 25 06:53:25 UTC 2022 - jslaby@suse.cz

View File

@ -1,4 +1,4 @@
name: klee
version: 2.3+20220926
mtime: 1664181727
commit: 667ce0f1ef33c32fbe2d1836fc1b334066e244ca
version: 2.3+20230320
mtime: 1679328338
commit: 1398e960ec9aca3f0ceac5e37062631986b9c2a8

View File

@ -1,7 +1,7 @@
#
# spec file for package klee
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -31,7 +31,7 @@ Name: klee
Summary: LLVM Execution Engine
License: NCSA
Group: Development/Languages/Other
Version: 2.3+20220926
Version: 2.3+20230320
Release: 0
URL: http://klee.github.io/
Source0: %{name}-%{version}.tar.xz
@ -39,10 +39,7 @@ Source1: %{name}-rpmlintrc
Source2: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/not/not.cpp
Source3: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/FileCheck/FileCheck.cpp
Patch0: 0001-test-disable-until-it-is-fixed.patch
Patch1: 0001-llvm14-Add-LLVM-14-to-lit.cfg.patch
Patch2: 0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch
Patch3: 0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch
Patch4: 0003-llvm14-PointerType-getElementType-was-deprecated.patch
Patch1: 0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch
BuildRequires: clang%{llvm_version}
BuildRequires: cmake
BuildRequires: gperftools-devel