up to 1.4.0+20180524

OBS-URL: https://build.opensuse.org/package/show/devel:tools:statica/klee?expand=0&rev=46
This commit is contained in:
Jiri Slaby 2018-05-25 11:02:36 +00:00 committed by Git OBS Bridge
parent f7338a04e6
commit e2ce9b9cb2
28 changed files with 44 additions and 3053 deletions

View File

@ -1,73 +0,0 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Thu, 15 Jun 2017 15:20:49 +0200
Subject: llvm37: handle GetElementPtrInst::Create's new parameter
Patch-mainline: no
LLVM 3.7 added a PointeeType parameter to GetElementPtrInst::Create.
Let's handle that by a macro called KLEE_LLVM_GEP_TYPE, defined in
Version.h.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
include/klee/Config/Version.h | 6 ++++++
lib/Core/ExternalDispatcher.cpp | 1 +
lib/Module/IntrinsicCleaner.cpp | 12 ++++++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h
index ccf54ae13092..532051602fe3 100644
--- a/include/klee/Config/Version.h
+++ b/include/klee/Config/Version.h
@@ -15,6 +15,12 @@
#define LLVM_VERSION(major, minor) (((major) << 8) | (minor))
#define LLVM_VERSION_CODE LLVM_VERSION(LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+# define KLEE_LLVM_GEP_TYPE(x) (x),
+#else
+# define KLEE_LLVM_GEP_TYPE(x)
+#endif
+
#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
# define KLEE_LLVM_CL_VAL_END
#else
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index 70c14050e8e7..72b866cf6395 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -326,6 +326,7 @@ Function *ExternalDispatcherImpl::createDispatcher(Function *target,
Type *argTy =
(i < FTy->getNumParams() ? FTy->getParamType(i) : (*ai)->getType());
Instruction *argI64p = GetElementPtrInst::Create(
+ KLEE_LLVM_GEP_TYPE(nullptr)
argI64s, ConstantInt::get(Type::getInt32Ty(ctx), idx), "", dBB);
Instruction *argp =
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 2ac9db62f67d..3729ff82cd9d 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -86,12 +86,16 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) {
Value *val = new LoadInst(pSrc, std::string(), ii);
new StoreInst(val, pDst, ii);
Value *off = ConstantInt::get(Type::getInt64Ty(ctx), 1);
- pDst = GetElementPtrInst::Create(pDst, off, std::string(), ii);
- pSrc = GetElementPtrInst::Create(pSrc, off, std::string(), ii);
+ pDst = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+ pDst, off, std::string(), ii);
+ pSrc = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+ pSrc, off, std::string(), ii);
val = new LoadInst(pSrc, std::string(), ii);
new StoreInst(val, pDst, ii);
- pDst = GetElementPtrInst::Create(pDst, off, std::string(), ii);
- pSrc = GetElementPtrInst::Create(pSrc, off, std::string(), ii);
+ pDst = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+ pDst, off, std::string(), ii);
+ pSrc = GetElementPtrInst::Create(KLEE_LLVM_GEP_TYPE(nullptr)
+ pSrc, off, std::string(), ii);
val = new LoadInst(pSrc, std::string(), ii);
new StoreInst(val, pDst, ii);
}
--
2.17.0

View File

@ -1,177 +0,0 @@
From: =?UTF-8?q?Richard=20Trembeck=C3=BD?= <richardt@centrum.sk>
Date: Thu, 28 Apr 2016 18:27:24 +0200
Subject: llvm: make KLEE compile against LLVM 3.7
Patch-mainline: no
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
.../klee/Internal/Support/FloatEvaluation.h | 7 +++++
lib/Module/InstructionInfoTable.cpp | 6 ++++
lib/Module/ModuleUtil.cpp | 30 ++++++++++++++++---
lib/Module/Optimize.cpp | 4 ++-
lib/Module/RaiseAsm.cpp | 5 +++-
tools/klee/main.cpp | 1 +
6 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/include/klee/Internal/Support/FloatEvaluation.h b/include/klee/Internal/Support/FloatEvaluation.h
index 6d9092f2ea37..436e0dc8152f 100644
--- a/include/klee/Internal/Support/FloatEvaluation.h
+++ b/include/klee/Internal/Support/FloatEvaluation.h
@@ -132,8 +132,15 @@ inline uint64_t mod(uint64_t l, uint64_t r, unsigned inWidth) {
// determine if l represents NaN
inline bool isNaN(uint64_t l, unsigned inWidth) {
switch( inWidth ) {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ case FLT_BITS:
+ return std::isnan(UInt64AsFloat(l));
+ case DBL_BITS:
+ return std::isnan(UInt64AsDouble(l));
+#else
case FLT_BITS: return llvm::IsNAN( UInt64AsFloat(l) );
case DBL_BITS: return llvm::IsNAN( UInt64AsDouble(l) );
+#endif
default: llvm::report_fatal_error("unsupported floating point width");
}
}
diff --git a/lib/Module/InstructionInfoTable.cpp b/lib/Module/InstructionInfoTable.cpp
index e2f05205a633..3d9bf5ae66af 100644
--- a/lib/Module/InstructionInfoTable.cpp
+++ b/lib/Module/InstructionInfoTable.cpp
@@ -94,9 +94,15 @@ bool InstructionInfoTable::getInstructionDebugInfo(const llvm::Instruction *I,
const std::string *&File,
unsigned &Line) {
if (MDNode *N = I->getMetadata("dbg")) {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ DILocation *Loc = cast<DILocation>(N);
+ File = internString(getDSPIPath(*Loc));
+ Line = Loc->getLine();
+#else
DILocation Loc(N);
File = internString(getDSPIPath(Loc));
Line = Loc.getLineNumber();
+#endif
return true;
}
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
index a86adc98a1b1..b07d3d2fe348 100644
--- a/lib/Module/ModuleUtil.cpp
+++ b/lib/Module/ModuleUtil.cpp
@@ -258,13 +258,21 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er
Module *Result = 0;
// FIXME: Maybe load bitcode file lazily? Then if we need to link, materialise the module
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
- ErrorOr<Module *> resultErr = parseBitcodeFile(buff.get(),
- composite->getContext());
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ ErrorOr<std::unique_ptr<Module> > resultErr =
+#else
+ ErrorOr<Module *> resultErr =
+#endif
+ parseBitcodeFile(buff.get(), composite->getContext());
ec = resultErr.getError();
if (ec)
errorMessage = ec.message();
else
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ Result = resultErr->release();
+#else
Result = resultErr.get();
+#endif
#else
Result = ParseBitcodeFile(buff.get(), composite->getContext(),
&errorMessage);
@@ -421,7 +429,12 @@ Module *klee::linkWithLibrary(Module *module,
if (magic == sys::fs::file_magic::bitcode) {
Module *Result = 0;
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
- ErrorOr<Module *> ResultErr = parseBitcodeFile(Buffer, Context);
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ ErrorOr<std::unique_ptr<Module> > ResultErr =
+#else
+ ErrorOr<Module *> ResultErr =
+#endif
+ parseBitcodeFile(Buffer, Context);
if ((ec = ResultErr.getError())) {
ErrorMessage = ec.message();
#else
@@ -432,7 +445,9 @@ Module *klee::linkWithLibrary(Module *module,
ErrorMessage.c_str());
}
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ Result = ResultErr->release();
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
Result = ResultErr.get();
#endif
@@ -446,7 +461,10 @@ Module *klee::linkWithLibrary(Module *module,
ErrorMessage.c_str());
}
+// unique_ptr owns the Module, we don't have to delete it
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 7)
delete Result;
+#endif
} else if (magic == sys::fs::file_magic::archive) {
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
@@ -615,7 +633,11 @@ Module *klee::loadModule(LLVMContext &ctx, const std::string &path, std::string
// The module has taken ownership of the MemoryBuffer so release it
// from the std::unique_ptr
buffer->release();
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ auto module = errorOrModule->release();
+#else
auto module = *errorOrModule;
+#endif
if (auto ec = module->materializeAllPermanently()) {
errorMsg = ec.message();
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
index 02ab446a8d63..64e4863f70b3 100644
--- a/lib/Module/Optimize.cpp
+++ b/lib/Module/Optimize.cpp
@@ -154,7 +154,9 @@ void Optimize(Module *M, const std::string &EntryPoint) {
Passes.add(createVerifierPass());
// Add an appropriate DataLayout instance for this module...
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ // LLVM 3.7+ doesn't have DataLayoutPass anymore.
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
DataLayoutPass *dlpass = new DataLayoutPass();
dlpass->doInitialization(*M);
addPass(Passes, dlpass);
diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp
index 13e4f7d47e58..c597fa2a7b82 100644
--- a/lib/Module/RaiseAsm.cpp
+++ b/lib/Module/RaiseAsm.cpp
@@ -81,7 +81,10 @@ bool RaiseAsmPass::runOnModule(Module &M) {
klee_warning("Warning: unable to select native target: %s", Err.c_str());
TLI = 0;
} else {
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ TM = NativeTarget->createTargetMachine(HostTriple, "", "", TargetOptions());
+ TLI = TM->getSubtargetImpl(*(M.begin()))->getTargetLowering();
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
TM = NativeTarget->createTargetMachine(HostTriple, "", "", TargetOptions());
TLI = TM->getSubtargetImpl()->getTargetLowering();
#else
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 44bc5407e9c8..ab9dfe286ffb 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -35,6 +35,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/TargetSelect.h"
--
2.17.0

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +0,0 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Tue, 10 Oct 2017 14:52:57 +0200
Subject: llvm37: handle getRegisteredOptions
Patch-mainline: no
In LLVM 3.7 and later, getRegisteredOptions takes no arguments and
returns the map directly.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Basic/CmdLineOptions.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/Basic/CmdLineOptions.cpp b/lib/Basic/CmdLineOptions.cpp
index aaba72f4b5b7..3c117db9fa7b 100644
--- a/lib/Basic/CmdLineOptions.cpp
+++ b/lib/Basic/CmdLineOptions.cpp
@@ -86,8 +86,12 @@ UseAssignmentValidatingSolver("debug-assignment-validating-solver",
cl::init(false));
void KCommandLine::HideUnrelatedOptions(cl::OptionCategory &Category) {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7)
+ StringMap<cl::Option *> &map = cl::getRegisteredOptions();
+#else
StringMap<cl::Option *> map;
cl::getRegisteredOptions(map);
+#endif
for (StringMap<cl::Option *>::iterator i = map.begin(), e = map.end(); i != e;
i++) {
if (i->second->Category != &Category) {
--
2.17.0

View File

@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/klee/klee.git</param>
<param name="changesrevision">4e0ec744a8170f3d82aa1a8658fd523442781da2</param></service></servicedata>
<param name="changesrevision">843e9be8fc10c6ffb30218c5a826aab192a31955</param></service></servicedata>

View File

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

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Fri May 25 10:57:57 UTC 2018 - opensuse-packaging@opensuse.org
- Update to version 1.4.0+20180524:
* isLSB should be a boolean, as it is only used in truth contexts
* remove switch fallthrough in floating point comparision
* llvm37: enable travis testing
* llvm37: handle getRegisteredOptions
* test: add versions of some tests for LLVM 3.7
* llvm: make KLEE compile against LLVM 3.7
* llvm37: handle GetElementPtrInst::Create's new parameter
* test: add parenthesis around & operands
- removed patches that are in upstream now:
* 0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
* 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
* 0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
* 0004-llvm37-handle-getRegisteredOptions.patch
-------------------------------------------------------------------
Wed May 23 12:25:13 UTC 2018 - opensuse-packaging@opensuse.org

View File

@ -19,7 +19,7 @@
%define llvm_version_minor 0
%define llvm_version %{llvm_version_major}
%define version_unconverted 1.4.0+20180522
%define version_unconverted 1.4.0+20180524
%ifarch %{ix86} x86_64
%define with_uclibc 1
@ -31,7 +31,7 @@ Name: klee
Summary: LLVM Execution Engine
License: NCSA
Group: Development/Languages/Other
Version: 1.4.0+20180522
Version: 1.4.0+20180524
Release: 0
Url: http://klee.github.io/
Source0: %{name}-%{version}.tar.xz
@ -39,30 +39,26 @@ 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-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
Patch202: 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
Patch203: 0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
Patch204: 0004-llvm37-handle-getRegisteredOptions.patch
Patch205: 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
Patch206: 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
Patch207: 0007-llvm38-test-change-some-tests.patch
Patch208: 0008-llvm40-handle-different-header-names.patch
Patch209: 0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
Patch210: 0010-llvm40-errorOr-and-similar.patch
Patch211: 0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch
Patch212: 0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
Patch213: 0013-llvm40-gep_type_iterator-has-no-operator.patch
Patch214: 0014-llvm50-avoid-on-function-arg_begin.patch
Patch215: 0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch
Patch216: 0016-llvm50-handle-getOrInsertFunction-terminator.patch
Patch217: 0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch
Patch218: 0018-llvm50-handle-new-file_magic-s-location.patch
Patch219: 0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch
Patch220: 0020-llvm50-AllocaInst-takes-address-space.patch
Patch221: 0021-llvm50-Intrinsic-objectsize-has-three-arguments.patch
Patch222: 0022-llvm50-test-change-objectsize.patch
Patch223: 0023-llvm60-SetVersionPrinter-now-passes-down-a-stream.patch
Patch224: 0024-llvm60-handle-headers-renaming.patch
Patch201: 0001-llvm-make-KLEE-compile-against-LLVM-3.8.patch
Patch202: 0002-llvm38-test-change-some-tests.patch
Patch203: 0003-llvm-make-KLEE-compile-against-LLVM-3.9.patch
Patch204: 0004-llvm40-handle-different-header-names.patch
Patch205: 0005-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
Patch206: 0006-llvm40-errorOr-and-similar.patch
Patch207: 0007-llvm-use-chrono-helpers-from-LLVM-4.0.patch
Patch208: 0008-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
Patch209: 0009-llvm40-gep_type_iterator-has-no-operator.patch
Patch210: 0010-llvm50-avoid-on-function-arg_begin.patch
Patch211: 0011-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch
Patch212: 0012-llvm50-handle-getOrInsertFunction-terminator.patch
Patch213: 0013-llvm50-SwitchInst-case-functions-now-return-pointers.patch
Patch214: 0014-llvm50-handle-new-file_magic-s-location.patch
Patch215: 0015-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch
Patch216: 0016-llvm50-AllocaInst-takes-address-space.patch
Patch217: 0017-llvm50-Intrinsic-objectsize-has-three-arguments.patch
Patch218: 0018-llvm50-test-change-objectsize.patch
Patch219: 0019-llvm60-SetVersionPrinter-now-passes-down-a-stream.patch
Patch220: 0020-llvm60-handle-headers-renaming.patch
Patch300: klee-skip-some-tests.patch
@ -112,10 +108,6 @@ information on what KLEE is and what it can do, see the OSDI 2008 paper.
%patch218 -p1
%patch219 -p1
%patch220 -p1
%patch221 -p1
%patch222 -p1
%patch223 -p1
%patch224 -p1
#%%patch300 -p1