update to 1.4.0+20181026
OBS-URL: https://build.opensuse.org/package/show/devel:tools:statica/klee?expand=0&rev=58
This commit is contained in:
parent
611b54d753
commit
7b8f3e8bd6
@ -1,36 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 15 Jan 2018 10:35:19 +0100
|
||||
Subject: llvm5: avoid ++ on function->arg_begin()
|
||||
Patch-mainline: no
|
||||
|
||||
Starting with llvm 5, arguments of a function are not an iterator, but
|
||||
an array. So they cannot be incremented in-place. Add a local auto
|
||||
variable and increment that.
|
||||
|
||||
Otherwise we see:
|
||||
../tools/klee/main.cpp:661:23: error: expression is not assignable
|
||||
Value *oldArgv = &*(++mainFn->arg_begin());
|
||||
^ ~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
tools/klee/main.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
|
||||
index 1de5fbeb7e0e..3be619138bd6 100644
|
||||
--- a/tools/klee/main.cpp
|
||||
+++ b/tools/klee/main.cpp
|
||||
@@ -1036,7 +1036,8 @@ createLibCWrapper(std::vector<std::unique_ptr<llvm::Module>> &modules,
|
||||
args.push_back(
|
||||
llvm::ConstantExpr::getBitCast(inModuleRefernce, ft->getParamType(0)));
|
||||
args.push_back(&*(stub->arg_begin())); // argc
|
||||
- args.push_back(&*(++stub->arg_begin())); // argv
|
||||
+ auto arg_it = stub->arg_begin();
|
||||
+ args.push_back(&*(++arg_it)); // argv
|
||||
args.push_back(Constant::getNullValue(ft->getParamType(3))); // app_init
|
||||
args.push_back(Constant::getNullValue(ft->getParamType(4))); // app_fini
|
||||
args.push_back(Constant::getNullValue(ft->getParamType(5))); // rtld_fini
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,32 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 15 Jan 2018 10:09:20 +0100
|
||||
Subject: llvm5: integerPartWidth is from llvm::APFloatBase
|
||||
Patch-mainline: no
|
||||
|
||||
Otherwise we see:
|
||||
../lib/Expr/Expr.cpp:331:14: error: no member named 'integerPartWidth' in namespace 'llvm'; did you mean 'llvm::APFloatBase::integerPartWidth'?
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Expr/Expr.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
|
||||
index a5c7f652e976..65e858c3336d 100644
|
||||
--- a/lib/Expr/Expr.cpp
|
||||
+++ b/lib/Expr/Expr.cpp
|
||||
@@ -333,7 +333,11 @@ ref<Expr> ConstantExpr::fromMemory(void *address, Width 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));
|
||||
}
|
||||
}
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,75 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 15 Jan 2018 10:27:54 +0100
|
||||
Subject: llvm5: handle getOrInsertFunction terminator
|
||||
Patch-mainline: no
|
||||
|
||||
llvm 5 does not terminate getOrInsertFunction parameters with NULL, take
|
||||
care of that.
|
||||
|
||||
Since commit 9d54400bba7eb04bca80fce97fa170452d19eaf1.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
include/klee/Config/Version.h | 6 ++++++
|
||||
lib/Module/Checks.cpp | 8 ++++----
|
||||
lib/Module/IntrinsicCleaner.cpp | 3 ++-
|
||||
3 files changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h
|
||||
index 532051602fe3..a02ce28baaae 100644
|
||||
--- a/include/klee/Config/Version.h
|
||||
+++ b/include/klee/Config/Version.h
|
||||
@@ -27,4 +27,10 @@
|
||||
# define KLEE_LLVM_CL_VAL_END , clEnumValEnd
|
||||
#endif
|
||||
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+# define KLEE_LLVM_GOIF_TERMINATOR
|
||||
+#else
|
||||
+# define KLEE_LLVM_GOIF_TERMINATOR , NULL
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
diff --git a/lib/Module/Checks.cpp b/lib/Module/Checks.cpp
|
||||
index aac63e1d9854..406b3045e527 100644
|
||||
--- a/lib/Module/Checks.cpp
|
||||
+++ b/lib/Module/Checks.cpp
|
||||
@@ -57,8 +57,8 @@ bool DivCheckPass::runOnModule(Module &M) {
|
||||
if (!divZeroCheckFunction) {
|
||||
Constant *fc = M.getOrInsertFunction("klee_div_zero_check",
|
||||
Type::getVoidTy(ctx),
|
||||
- Type::getInt64Ty(ctx),
|
||||
- NULL);
|
||||
+ Type::getInt64Ty(ctx)
|
||||
+ KLEE_LLVM_GOIF_TERMINATOR);
|
||||
divZeroCheckFunction = cast<Function>(fc);
|
||||
}
|
||||
|
||||
@@ -118,8 +118,8 @@ bool OvershiftCheckPass::runOnModule(Module &M) {
|
||||
Constant *fc = M.getOrInsertFunction("klee_overshift_check",
|
||||
Type::getVoidTy(ctx),
|
||||
Type::getInt64Ty(ctx),
|
||||
- Type::getInt64Ty(ctx),
|
||||
- NULL);
|
||||
+ Type::getInt64Ty(ctx)
|
||||
+ KLEE_LLVM_GOIF_TERMINATOR);
|
||||
overshiftCheckFunction = cast<Function>(fc);
|
||||
}
|
||||
|
||||
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
|
||||
index c48952c28004..ab16a2654492 100644
|
||||
--- a/lib/Module/IntrinsicCleaner.cpp
|
||||
+++ b/lib/Module/IntrinsicCleaner.cpp
|
||||
@@ -210,7 +210,8 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) {
|
||||
// Intrinsic instruction "llvm.trap" found. Directly lower it to
|
||||
// a call of the abort() function.
|
||||
Function *F = cast<Function>(
|
||||
- M.getOrInsertFunction("abort", Type::getVoidTy(ctx), NULL));
|
||||
+ M.getOrInsertFunction("abort", Type::getVoidTy(ctx)
|
||||
+ KLEE_LLVM_GOIF_TERMINATOR));
|
||||
F->setDoesNotReturn();
|
||||
F->setDoesNotThrow();
|
||||
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,35 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 15 Jan 2018 10:38:35 +0100
|
||||
Subject: llvm5: SwitchInst case functions now return pointers
|
||||
Patch-mainline: no
|
||||
|
||||
Starting llvm 5, SwitchInst->findCaseValue() now has to be dereferenced
|
||||
using ->. So do so, otherwise we see:
|
||||
../lib/Core/Executor.cpp:1598:38: error: no member named 'getCaseSuccessor' in 'llvm::SwitchInst::CaseIteratorImpl<llvm::SwitchInst::CaseHandle>'; did you mean to use '->' instead of '.'?
|
||||
BasicBlock *caseSuccessor = i.getCaseSuccessor();
|
||||
^
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Core/Executor.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
|
||||
index 04fd6941d34a..64d0f66e4073 100644
|
||||
--- a/lib/Core/Executor.cpp
|
||||
+++ b/lib/Core/Executor.cpp
|
||||
@@ -1673,7 +1673,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
|
||||
// switch to an internal rep.
|
||||
llvm::IntegerType *Ty = cast<IntegerType>(si->getCondition()->getType());
|
||||
ConstantInt *ci = ConstantInt::get(Ty, CE->getZExtValue());
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ unsigned index = si->findCaseValue(ci)->getSuccessorIndex();
|
||||
+#else
|
||||
unsigned index = si->findCaseValue(ci).getSuccessorIndex();
|
||||
+#endif
|
||||
transferToBasicBlock(si->getSuccessor(index), si->getParent(), state);
|
||||
} else {
|
||||
// Handle possible different branch targets
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,63 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 15 Jan 2018 10:42:53 +0100
|
||||
Subject: llvm5: handle new file_magic's location
|
||||
Patch-mainline: no
|
||||
|
||||
llvm 5, moved file_magic to BinaryFormat in commit
|
||||
19ca2b0f9daed883c21730285d7f04424e5f5f88, so adapt to that.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Module/ModuleUtil.cpp | 15 ++++++++++++++-
|
||||
1 file changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
|
||||
index bfec9e7dc7ff..ecc114460a3f 100644
|
||||
--- a/lib/Module/ModuleUtil.cpp
|
||||
+++ b/lib/Module/ModuleUtil.cpp
|
||||
@@ -14,6 +14,9 @@
|
||||
#include "klee/Internal/Support/ErrorHandling.h"
|
||||
#include "../Core/SpecialFunctionHandler.h"
|
||||
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+#include "llvm/BinaryFormat/Magic.h"
|
||||
+#endif
|
||||
#include "llvm/IR/Function.h"
|
||||
#include "llvm/IR/Instructions.h"
|
||||
#include "llvm/IR/IntrinsicInst.h"
|
||||
@@ -381,13 +384,19 @@ bool klee::loadFile(const std::string &fileName, LLVMContext &context,
|
||||
MemoryBuffer *Buffer = bufferErr->get();
|
||||
#endif
|
||||
|
||||
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ file_magic magic = identify_magic(Buffer.getBuffer());
|
||||
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
|
||||
sys::fs::file_magic magic = sys::fs::identify_magic(Buffer.getBuffer());
|
||||
#else
|
||||
sys::fs::file_magic magic = sys::fs::identify_magic(Buffer->getBuffer());
|
||||
#endif
|
||||
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ if (magic == file_magic::bitcode) {
|
||||
+#else
|
||||
if (magic == sys::fs::file_magic::bitcode) {
|
||||
+#endif
|
||||
SMDiagnostic Err;
|
||||
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
|
||||
std::unique_ptr<llvm::Module> module(parseIR(Buffer, Err, context));
|
||||
@@ -404,7 +413,11 @@ bool klee::loadFile(const std::string &fileName, LLVMContext &context,
|
||||
return true;
|
||||
}
|
||||
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ if (magic == file_magic::archive) {
|
||||
+#else
|
||||
if (magic == sys::fs::file_magic::archive) {
|
||||
+#endif
|
||||
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
|
||||
Expected<std::unique_ptr<object::Binary> > archOwner =
|
||||
object::createBinary(Buffer, &context);
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,49 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 15 Jan 2018 11:07:47 +0100
|
||||
Subject: llvm5: use MutableArrayRef for APFloat::convertToInteger
|
||||
Patch-mainline: no
|
||||
|
||||
In llvm 5, since commit 957caa243d9270df37a566aedae3f1244e7b62ef, the
|
||||
first parameter to APFloat::convertToInteger is MutableArrayRef. So
|
||||
handle that.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Core/Executor.cpp | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
|
||||
index 64d0f66e4073..b5d7e6ce8f6c 100644
|
||||
--- a/lib/Core/Executor.cpp
|
||||
+++ b/lib/Core/Executor.cpp
|
||||
@@ -2326,7 +2326,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
|
||||
llvm::APFloat Arg(*fpWidthToSemantics(arg->getWidth()), arg->getAPValue());
|
||||
uint64_t value = 0;
|
||||
bool isExact = true;
|
||||
- Arg.convertToInteger(&value, resultType, false,
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ auto valueRef = makeMutableArrayRef(value);
|
||||
+#else
|
||||
+ uint64_t *valueRef = &value;
|
||||
+#endif
|
||||
+ Arg.convertToInteger(valueRef, resultType, false,
|
||||
llvm::APFloat::rmTowardZero, &isExact);
|
||||
bindLocal(ki, state, ConstantExpr::alloc(value, resultType));
|
||||
break;
|
||||
@@ -2343,7 +2348,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
|
||||
|
||||
uint64_t value = 0;
|
||||
bool isExact = true;
|
||||
- Arg.convertToInteger(&value, resultType, true,
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ auto valueRef = makeMutableArrayRef(value);
|
||||
+#else
|
||||
+ uint64_t *valueRef = &value;
|
||||
+#endif
|
||||
+ Arg.convertToInteger(valueRef, resultType, true,
|
||||
llvm::APFloat::rmTowardZero, &isExact);
|
||||
bindLocal(ki, state, ConstantExpr::alloc(value, resultType));
|
||||
break;
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,52 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Wed, 23 May 2018 15:01:34 +0200
|
||||
Subject: llvm5: Intrinsic::objectsize has three arguments
|
||||
Patch-mainline: no
|
||||
|
||||
Modify the IntrinsicCleaner accordingly.
|
||||
|
||||
We do not do anything with the third argument as we do not handle the
|
||||
first argument in any way.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Module/IntrinsicCleaner.cpp | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
|
||||
index ab16a2654492..ee65be69e543 100644
|
||||
--- a/lib/Module/IntrinsicCleaner.cpp
|
||||
+++ b/lib/Module/IntrinsicCleaner.cpp
|
||||
@@ -227,13 +227,29 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) {
|
||||
case Intrinsic::objectsize: {
|
||||
// We don't know the size of an object in general so we replace
|
||||
// with 0 or -1 depending on the second argument to the intrinsic.
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ assert(ii->getNumArgOperands() == 3 && "wrong number of arguments");
|
||||
+#else
|
||||
assert(ii->getNumArgOperands() == 2 && "wrong number of arguments");
|
||||
+#endif
|
||||
+
|
||||
Value *minArg = ii->getArgOperand(1);
|
||||
assert(minArg && "Failed to get second argument");
|
||||
ConstantInt *minArgAsInt = dyn_cast<ConstantInt>(minArg);
|
||||
assert(minArgAsInt && "Second arg is not a ConstantInt");
|
||||
assert(minArgAsInt->getBitWidth() == 1 &&
|
||||
"Second argument is not an i1");
|
||||
+
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ auto nullArg = ii->getArgOperand(2);
|
||||
+ assert(nullArg && "Failed to get second argument");
|
||||
+ auto nullArgAsInt = dyn_cast<ConstantInt>(nullArg);
|
||||
+ assert(nullArgAsInt && "Third arg is not a ConstantInt");
|
||||
+ assert(nullArgAsInt->getBitWidth() == 1 &&
|
||||
+ "Third argument is not an i1");
|
||||
+ /* TODO should we do something with the 3rd argument? */
|
||||
+#endif
|
||||
+
|
||||
Value *replacement = NULL;
|
||||
IntegerType *intType = dyn_cast<IntegerType>(ii->getType());
|
||||
assert(intType && "intrinsic does not have integer return type");
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,99 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Wed, 23 May 2018 14:54:48 +0200
|
||||
Subject: llvm5: test, change objectsize
|
||||
Patch-mainline: no
|
||||
|
||||
@llvm.objectsize has now three aguments, so fix the tests accordingly.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
test/Intrinsics/objectsize.leq49.ll | 38 +++++++++++++++++++++++++++++
|
||||
test/Intrinsics/objectsize.ll | 9 ++++---
|
||||
2 files changed, 43 insertions(+), 4 deletions(-)
|
||||
create mode 100644 test/Intrinsics/objectsize.leq49.ll
|
||||
|
||||
diff --git a/test/Intrinsics/objectsize.leq49.ll b/test/Intrinsics/objectsize.leq49.ll
|
||||
new file mode 100644
|
||||
index 000000000000..1d184bdf292d
|
||||
--- /dev/null
|
||||
+++ b/test/Intrinsics/objectsize.leq49.ll
|
||||
@@ -0,0 +1,38 @@
|
||||
+; Unfortunately LLVM 2.9 has a different suffix for the ``llvm.objectsize`` instrinsic
|
||||
+; so this LLVM IR fails to verify for that version.
|
||||
+;
|
||||
+; LLVM 3.7 requires a type as the first argument to 'load'
|
||||
+; REQUIRES: geq-llvm-3.7
|
||||
+; REQUIRES: lt-llvm-5.0
|
||||
+; RUN: %llvmas %s -o=%t.bc
|
||||
+; RUN: rm -rf %t.klee-out
|
||||
+; RUN: %klee -exit-on-error --output-dir=%t.klee-out -disable-opt %t.bc
|
||||
+; ModuleID = 'objectsize.c'
|
||||
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-unknown-linux-gnu"
|
||||
+
|
||||
+define i32 @main() nounwind uwtable {
|
||||
+entry:
|
||||
+ %a = alloca i8*, align 8
|
||||
+ %0 = load i8*, i8** %a, align 8
|
||||
+ %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %0, i1 true)
|
||||
+ %cmp = icmp ne i64 %1, 0
|
||||
+ br i1 %cmp, label %abort.block, label %continue.block
|
||||
+
|
||||
+continue.block:
|
||||
+ %2 = load i8*, i8** %a, align 8
|
||||
+ %3 = call i64 @llvm.objectsize.i64.p0i8(i8* %2, i1 false)
|
||||
+ %cmp1 = icmp ne i64 %3, -1
|
||||
+ br i1 %cmp1, label %abort.block, label %exit.block
|
||||
+
|
||||
+exit.block:
|
||||
+ ret i32 0
|
||||
+
|
||||
+abort.block:
|
||||
+ call void @abort()
|
||||
+ unreachable
|
||||
+}
|
||||
+
|
||||
+declare i64 @llvm.objectsize.i64.p0i8(i8*, i1) nounwind readnone
|
||||
+
|
||||
+declare void @abort() noreturn nounwind
|
||||
diff --git a/test/Intrinsics/objectsize.ll b/test/Intrinsics/objectsize.ll
|
||||
index 3a111f99c619..95070e66e45c 100644
|
||||
--- a/test/Intrinsics/objectsize.ll
|
||||
+++ b/test/Intrinsics/objectsize.ll
|
||||
@@ -2,7 +2,8 @@
|
||||
; so this LLVM IR fails to verify for that version.
|
||||
;
|
||||
; LLVM 3.7 requires a type as the first argument to 'load'
|
||||
-; REQUIRES: geq-llvm-3.7
|
||||
+; LLVM 5 added nullunknown parameter to @llvm.objectsize
|
||||
+; REQUIRES: geq-llvm-5.0
|
||||
; RUN: %llvmas %s -o=%t.bc
|
||||
; RUN: rm -rf %t.klee-out
|
||||
; RUN: %klee -exit-on-error --output-dir=%t.klee-out -disable-opt %t.bc
|
||||
@@ -14,13 +15,13 @@ define i32 @main() nounwind uwtable {
|
||||
entry:
|
||||
%a = alloca i8*, align 8
|
||||
%0 = load i8*, i8** %a, align 8
|
||||
- %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %0, i1 true)
|
||||
+ %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %0, i1 true, i1 false)
|
||||
%cmp = icmp ne i64 %1, 0
|
||||
br i1 %cmp, label %abort.block, label %continue.block
|
||||
|
||||
continue.block:
|
||||
%2 = load i8*, i8** %a, align 8
|
||||
- %3 = call i64 @llvm.objectsize.i64.p0i8(i8* %2, i1 false)
|
||||
+ %3 = call i64 @llvm.objectsize.i64.p0i8(i8* %2, i1 false, i1 false)
|
||||
%cmp1 = icmp ne i64 %3, -1
|
||||
br i1 %cmp1, label %abort.block, label %exit.block
|
||||
|
||||
@@ -32,6 +33,6 @@ abort.block:
|
||||
unreachable
|
||||
}
|
||||
|
||||
-declare i64 @llvm.objectsize.i64.p0i8(i8*, i1) nounwind readnone
|
||||
+declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1) nounwind readnone
|
||||
|
||||
declare void @abort() noreturn nounwind
|
||||
--
|
||||
2.19.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,46 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Fri, 20 Jul 2018 10:06:29 +0200
|
||||
Subject: llvm5: CallSite.paramHasAttr is indexed from 0
|
||||
Patch-mainline: no
|
||||
|
||||
Since LLVM 5 commit 1f8f0490690b, CallSite.paramHasAttr is indexed from
|
||||
0, so make sure we use correct indexing in klee. And use
|
||||
CallSite.hasRetAttr for return attributes.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Core/Executor.cpp | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
|
||||
index b5d7e6ce8f6c..96285f74a462 100644
|
||||
--- a/lib/Core/Executor.cpp
|
||||
+++ b/lib/Core/Executor.cpp
|
||||
@@ -1543,7 +1543,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
|
||||
CallSite(cast<CallInst>(caller)));
|
||||
|
||||
// XXX need to check other param attrs ?
|
||||
- bool isSExt = cs.paramHasAttr(0, llvm::Attribute::SExt);
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ bool isSExt = cs.hasRetAttr(llvm::Attribute::SExt);
|
||||
+#else
|
||||
+ bool isSExt = cs.paramHasAttr(0, llvm::Attribute::SExt);
|
||||
+#endif
|
||||
if (isSExt) {
|
||||
result = SExtExpr::create(result, to);
|
||||
} else {
|
||||
@@ -1837,7 +1841,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
|
||||
|
||||
if (from != to) {
|
||||
// XXX need to check other param attrs ?
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
|
||||
+ bool isSExt = cs.paramHasAttr(i, llvm::Attribute::SExt);
|
||||
+#else
|
||||
bool isSExt = cs.paramHasAttr(i+1, llvm::Attribute::SExt);
|
||||
+#endif
|
||||
if (isSExt) {
|
||||
arguments[i] = SExtExpr::create(arguments[i], to);
|
||||
} else {
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,85 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 21 May 2018 15:12:44 +0200
|
||||
Subject: llvm6: SetVersionPrinter now passes down a stream
|
||||
Patch-mainline: no
|
||||
|
||||
I.e. klee::printVersion should now have a parameter -- the output
|
||||
stream. Change both the prototype and the implementation to handle this
|
||||
properly.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
include/klee/Internal/Support/PrintVersion.h | 8 +++++++
|
||||
lib/Support/PrintVersion.cpp | 23 ++++++++++++++------
|
||||
2 files changed, 24 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/include/klee/Internal/Support/PrintVersion.h b/include/klee/Internal/Support/PrintVersion.h
|
||||
index 2c375ad2b946..87f73a002914 100644
|
||||
--- a/include/klee/Internal/Support/PrintVersion.h
|
||||
+++ b/include/klee/Internal/Support/PrintVersion.h
|
||||
@@ -10,8 +10,16 @@
|
||||
#ifndef KLEE_PRINT_VERSION_H
|
||||
#define KLEE_PRINT_VERSION_H
|
||||
|
||||
+#include "llvm/Support/raw_ostream.h"
|
||||
+
|
||||
+#include "klee/Config/Version.h"
|
||||
+
|
||||
namespace klee {
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(6, 0)
|
||||
+ void printVersion(llvm::raw_ostream &OS);
|
||||
+#else
|
||||
void printVersion();
|
||||
+#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
diff --git a/lib/Support/PrintVersion.cpp b/lib/Support/PrintVersion.cpp
|
||||
index d39249df023f..b7f2b6ff347a 100644
|
||||
--- a/lib/Support/PrintVersion.cpp
|
||||
+++ b/lib/Support/PrintVersion.cpp
|
||||
@@ -9,25 +9,34 @@
|
||||
|
||||
#include "klee/Internal/Support/PrintVersion.h"
|
||||
#include "klee/Config/config.h"
|
||||
+#include "klee/Config/Version.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
#include "klee/Config/CompileTimeInfo.h"
|
||||
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(6, 0)
|
||||
+void klee::printVersion(llvm::raw_ostream &OS)
|
||||
+#else
|
||||
void klee::printVersion()
|
||||
+#endif
|
||||
{
|
||||
- llvm::outs() << PACKAGE_STRING " (" PACKAGE_URL ")\n";
|
||||
+#if LLVM_VERSION_CODE < LLVM_VERSION(6, 0)
|
||||
+ llvm::raw_ostream &OS = llvm::outs();
|
||||
+#endif
|
||||
+
|
||||
+ OS << PACKAGE_STRING " (" PACKAGE_URL ")\n";
|
||||
#ifdef KLEE_ENABLE_TIMESTAMP
|
||||
- llvm::outs() << " Built " __DATE__ " (" __TIME__ ")\n";
|
||||
+ OS << " Built " __DATE__ " (" __TIME__ ")\n";
|
||||
#endif
|
||||
- llvm::outs() << " Build mode: " << KLEE_BUILD_MODE "\n";
|
||||
- llvm::outs() << " Build revision: ";
|
||||
+ OS << " Build mode: " << KLEE_BUILD_MODE "\n";
|
||||
+ OS << " Build revision: ";
|
||||
#ifdef KLEE_BUILD_REVISION
|
||||
- llvm::outs() << KLEE_BUILD_REVISION "\n";
|
||||
+ OS << KLEE_BUILD_REVISION "\n";
|
||||
#else
|
||||
- llvm::outs() << "unknown\n";
|
||||
+ OS << "unknown\n";
|
||||
#endif
|
||||
// Show LLVM version information
|
||||
- llvm::outs() << "\n";
|
||||
+ OS << "\n";
|
||||
llvm::cl::PrintVersionMessage();
|
||||
}
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,37 +0,0 @@
|
||||
From: Jiri Slaby <jirislaby@gmail.com>
|
||||
Date: Mon, 21 May 2018 15:14:41 +0200
|
||||
Subject: llvm6: handle headers renaming
|
||||
Patch-mainline: no
|
||||
|
||||
Some headers were moved from llvm/Target/ to llvm/CodeGen/. Handle that.
|
||||
|
||||
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
|
||||
---
|
||||
lib/Module/RaiseAsm.cpp | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp
|
||||
index 4967a2fa8578..eef22fb81553 100644
|
||||
--- a/lib/Module/RaiseAsm.cpp
|
||||
+++ b/lib/Module/RaiseAsm.cpp
|
||||
@@ -18,10 +18,16 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/Host.h"
|
||||
#include "llvm/Support/TargetRegistry.h"
|
||||
+#if LLVM_VERSION_CODE >= LLVM_VERSION(6, 0)
|
||||
+#include "llvm/CodeGen/TargetLowering.h"
|
||||
+#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
||||
+#include "llvm/Target/TargetMachine.h"
|
||||
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
+#else
|
||||
+#include "llvm/Target/TargetLowering.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">git://github.com/klee/klee.git</param>
|
||||
<param name="changesrevision">4efd7f6b443f187f5a844227339383ce5593e865</param></service></servicedata>
|
||||
<param name="changesrevision">581dca9276cacc690703cd4962e309661fc71c23</param></service></servicedata>
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5bb676ee734644ba8e5b3cd125f30b92586db69d1ed1ca18976cc49160be5b31
|
||||
size 601236
|
3
klee-1.4.0+20181026.tar.xz
Normal file
3
klee-1.4.0+20181026.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b89e6b770654058ce876d974d47e4c165da35d72441bd3efaccb815c23d2c817
|
||||
size 618460
|
84
klee.changes
84
klee.changes
@ -1,3 +1,87 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 27 07:24:23 UTC 2018 - opensuse-packaging@opensuse.org
|
||||
|
||||
- Update to version 1.4.0+20181026:
|
||||
* travis: enable LLVM 7 testing
|
||||
* llvm7: handle new header files
|
||||
* llvm7: adapt to new openFileForWrite
|
||||
* llvm7: WriteBitcodeToFile takes Module &
|
||||
* Added gen-bout tool to generate ktest file (file.bout) using specified concrete arguments and files.
|
||||
* travis: enable LLVM 6 testing
|
||||
* llvm6: handle headers renaming
|
||||
* llvm6: SetVersionPrinter now passes down a stream
|
||||
* travis: enable LLVM 5 testing
|
||||
* llvm5: APInt->getSignBit -> getSignMask
|
||||
* llvm5: CallSite.paramHasAttr is indexed from 0
|
||||
* llvm5: test, add -disable-O0-optnone to -O0
|
||||
* llvm5: test, change objectsize
|
||||
* llvm5: Intrinsic::objectsize has three arguments
|
||||
* llvm5: use MutableArrayRef for APFloat::convertToInteger
|
||||
* llvm5: handle new file_magic's location
|
||||
* llvm5: SwitchInst case functions now return pointers
|
||||
* llvm5: handle getOrInsertFunction terminator
|
||||
* llvm5: integerPartWidth is from llvm::APFloatBase
|
||||
* llvm5: avoid ++ on function->arg_begin()
|
||||
* Add testcase for shift check
|
||||
* ShiftChecker: Instrument shift instructions only once
|
||||
* ShiftChecker: Avoid unneeded checks
|
||||
* ShiftCheck: Use llvm::Builder instead of Inst::Create*
|
||||
* Add test case for div checker
|
||||
* DivCheck do not instrument multiple times
|
||||
* DivCheck Skip unneeded checks
|
||||
* Use llvm::Builder for DivCheck instrumentation
|
||||
* Introduce KLEEIRMetaData to manipulate LLVM-IR metadata
|
||||
* Added lowering pass
|
||||
* refactor klee_open_output_file to return std::unique_ptr
|
||||
* use klee_open_output_file for uncompressed logs
|
||||
* Updated an include to reflect a recent filename change
|
||||
* Move unrelated function from ReadExpr class
|
||||
* Avoid unsafe static downcasts
|
||||
* Modernize code
|
||||
* Move optimization specific headers away from the project include directory
|
||||
* Clean-up headers
|
||||
* Use std::unordered collections as we use C++11
|
||||
* Remove unneeded externs
|
||||
* Remove condition check before function invocation
|
||||
* Move ConstantExpr check inside optimizeExpr function
|
||||
* optimizeExpr: return the result as return value instead as function argument
|
||||
* Make valueOnly parameter of optimizeExpr explicit
|
||||
* Fixed compilation of array optimization patch with LLVM >= 4.0
|
||||
* Added missing headers and clang-format the files
|
||||
* Added support for KLEE value-based array optimization
|
||||
* Added support for KLEE index-based array optimization
|
||||
* tests: disable CompressedExprLogging on zlib-less systems
|
||||
* Small changes to comments
|
||||
* Added missing header to SolverCmdLine.h and clang-format it
|
||||
* Renamed klee/CommandLine.h to klee/SolverCmdLine.h, since this file is meant to have only solver options.
|
||||
* fix handling of failing external calls
|
||||
* cmake/lit: add asan/non-asan, ubsan/non-ubsan flags
|
||||
* cleanup headers, whitespaces, and types
|
||||
* add support for klee-replay on OSX
|
||||
* Workaround for flaky coverage
|
||||
* kleeModule: always link irreader (required since llvm 3.3)
|
||||
* remove obsolete dependency of kleeModule on kleeCore
|
||||
* config.h.cmin: remove obsolete cmakedefine
|
||||
* Marking resolve methods as const
|
||||
* Refactored AddressSpace::resolve() by creating a new function AddressSpace::checkPointerInObject() that is called in both the forward and the backward searches. This makes the code more modular and removes a large part of duplicated code and should also address the non-deterministic coverage in the resolve() function which affects Codecov reports.
|
||||
* Fix a crash when the last running state is terminated during merging
|
||||
* Changed code to create up to 100 properly-numbered symbolic arguments, and add a corresponding check.
|
||||
* Add checks for correct usage of the POSIX model, together with an associated test.
|
||||
* Revert lit to 0.6.0 version, as 0.7.0 misbehaves
|
||||
- removed (in upstream):
|
||||
* 0001-llvm5-avoid-on-function-arg_begin.patch
|
||||
* 0002-llvm5-integerPartWidth-is-from-llvm-APFloatBase.patch
|
||||
* 0003-llvm5-handle-getOrInsertFunction-terminator.patch
|
||||
* 0004-llvm5-SwitchInst-case-functions-now-return-pointers.patch
|
||||
* 0005-llvm5-handle-new-file_magic-s-location.patch
|
||||
* 0006-llvm5-use-MutableArrayRef-for-APFloat-convertToInteg.patch
|
||||
* 0007-llvm5-Intrinsic-objectsize-has-three-arguments.patch
|
||||
* 0008-llvm5-test-change-objectsize.patch
|
||||
* 0009-llvm5-test-add-disable-O0-optnone-to-O0.patch
|
||||
* 0010-llvm5-CallSite.paramHasAttr-is-indexed-from-0.patch
|
||||
* 0011-llvm6-SetVersionPrinter-now-passes-down-a-stream.patch
|
||||
* 0012-llvm6-handle-headers-renaming.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 21 11:24:38 UTC 2018 - jslaby@suse.com
|
||||
|
||||
|
20
klee.spec
20
klee.spec
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package klee
|
||||
#
|
||||
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -15,11 +15,12 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%define llvm_version_major 6
|
||||
%define llvm_version_minor 0
|
||||
%define llvm_version %{llvm_version_major}
|
||||
|
||||
%define version_unconverted 1.4.0+20180920
|
||||
%define version_unconverted 1.4.0+20181026
|
||||
|
||||
%ifarch %{ix86} x86_64
|
||||
%define with_uclibc 1
|
||||
@ -31,7 +32,7 @@ Name: klee
|
||||
Summary: LLVM Execution Engine
|
||||
License: NCSA
|
||||
Group: Development/Languages/Other
|
||||
Version: 1.4.0+20180920
|
||||
Version: 1.4.0+20181026
|
||||
Release: 0
|
||||
Url: http://klee.github.io/
|
||||
Source0: %{name}-%{version}.tar.xz
|
||||
@ -39,19 +40,6 @@ Source1: %{name}-rpmlintrc
|
||||
Source2: https://raw.githubusercontent.com/llvm-mirror/llvm/release_%{llvm_version_major}%{llvm_version_minor}/utils/not/not.cpp
|
||||
Source3: https://raw.githubusercontent.com/llvm-mirror/llvm/release_%{llvm_version_major}%{llvm_version_minor}/utils/FileCheck/FileCheck.cpp
|
||||
|
||||
Patch201: 0001-llvm5-avoid-on-function-arg_begin.patch
|
||||
Patch202: 0002-llvm5-integerPartWidth-is-from-llvm-APFloatBase.patch
|
||||
Patch203: 0003-llvm5-handle-getOrInsertFunction-terminator.patch
|
||||
Patch204: 0004-llvm5-SwitchInst-case-functions-now-return-pointers.patch
|
||||
Patch205: 0005-llvm5-handle-new-file_magic-s-location.patch
|
||||
Patch206: 0006-llvm5-use-MutableArrayRef-for-APFloat-convertToInteg.patch
|
||||
Patch207: 0007-llvm5-Intrinsic-objectsize-has-three-arguments.patch
|
||||
Patch208: 0008-llvm5-test-change-objectsize.patch
|
||||
Patch209: 0009-llvm5-test-add-disable-O0-optnone-to-O0.patch
|
||||
Patch210: 0010-llvm5-CallSite.paramHasAttr-is-indexed-from-0.patch
|
||||
Patch211: 0011-llvm6-SetVersionPrinter-now-passes-down-a-stream.patch
|
||||
Patch212: 0012-llvm6-handle-headers-renaming.patch
|
||||
|
||||
BuildRequires: clang%{llvm_version}
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gperftools-devel
|
||||
|
Loading…
x
Reference in New Issue
Block a user