Hello community, here is the log from the commit of package klee for openSUSE:Factory checked in at 2018-05-30 12:24:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/klee (Old) and /work/SRC/openSUSE:Factory/.klee.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "klee" Wed May 30 12:24:15 2018 rev:9 rq:612990 version:1.4.0+20180524 Changes: -------- --- /work/SRC/openSUSE:Factory/klee/klee.changes 2018-01-31 19:53:57.747699321 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/klee.changes 2018-05-30 12:29:50.948828958 +0200 @@ -1,0 +2,134 @@ +Fri May 25 10:57:57 UTC 2018 - [email protected] + +- 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 +- renamed patches: + * 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch + -> 0001-llvm-make-KLEE-compile-against-LLVM-3.8.patch + * 0007-llvm38-test-change-some-tests.patch + -> 0002-llvm38-test-change-some-tests.patch + * 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch + -> 0003-llvm-make-KLEE-compile-against-LLVM-3.9.patch + * 0008-llvm40-handle-different-header-names.patch + -> 0004-llvm40-handle-different-header-names.patch + * 0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch + -> 0005-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch + * 0010-llvm40-errorOr-and-similar.patch + -> 0006-llvm40-errorOr-and-similar.patch + * 0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch + -> 0007-llvm-use-chrono-helpers-from-LLVM-4.0.patch + * 0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch + -> 0008-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch + * 0013-llvm40-gep_type_iterator-has-no-operator.patch + -> 0009-llvm40-gep_type_iterator-has-no-operator.patch + * 0014-llvm50-avoid-on-function-arg_begin.patch + -> 0010-llvm50-avoid-on-function-arg_begin.patch + * 0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch + -> 0011-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch + * 0016-llvm50-handle-getOrInsertFunction-terminator.patch + -> 0012-llvm50-handle-getOrInsertFunction-terminator.patch + * 0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch + -> 0013-llvm50-SwitchInst-case-functions-now-return-pointers.patch + * 0018-llvm50-handle-new-file_magic-s-location.patch + -> 0014-llvm50-handle-new-file_magic-s-location.patch + * 0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch + -> 0015-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch + * 0020-llvm50-AllocaInst-takes-address-space.patch + -> 0016-llvm50-AllocaInst-takes-address-space.patch +- added patches + * 0017-llvm50-Intrinsic-objectsize-has-three-arguments.patch + * 0018-llvm50-test-change-objectsize.patch + * 0019-llvm60-SetVersionPrinter-now-passes-down-a-stream.patch + * 0020-llvm60-handle-headers-renaming.patch + +------------------------------------------------------------------- +Wed May 23 12:25:13 UTC 2018 - [email protected] + +- Update to version 1.4.0+20180522: + * clang-format on lib/Module/{IntrinsicCleaner.cpp,Passes.h} + * some housekeeping in Passes.h and IntrinsicCleaner.cpp + * CompressionStream: fix sporadic segfaults (uninitialised avail_in) + * Removed .c_str() from getSourceLocation calls + * Renamed printFileLine to getSourceLocation (as suggested by @delcypher) to reflect the fact that it simply returns a string + * Simplified printFileLine by using std::to_string, and removed unneeded version that takes an argument a stream + * stop using DEBUG macro name + * fix some casts for LLP64 compilers + +------------------------------------------------------------------- +Mon May 21 09:30:16 UTC 2018 - [email protected] + +- Update to version 1.4.0+20180518: + * tests: use names in klee_make_symbolic + * Delete coverageServer.py + * Abort execution if --only-output-states-covering-new is enabled but its dependency --output-istats is not + * Add support for concretizing symbolic objects passed to external functions + * Improve error messages for ReadStringAtAddress + * Improved code quality + * Implemented incomplete merging + * remove QueryLog.h + * Update clang-format standard for KLEE codebase to C++11 + * Fix test case to check for correct call string + * Improve handling of constant array in Z3 + * Remove the option for truncating lines in assembly.ll + * Remove workaround for bug in older LLVM version (< 3) + * Fix include files + * remove unused file: tools/klee/Debug.cpp + * Fixed test case to exercise modification to utimes() + * Fixed utimes() behavior for symbolic files when the second argument is NULL + * Moved regression test to proper location. Fixes #705 + * Fix handling of errno if external functions are invoked + * Factor out method to update state memory with process state + * Ensured program reliably has 3 paths to be explored, and removed unnecessary options. Make klee_abort() call abort() in replay, and removed trivial test which cannot be easily integrated into the test suite. + * Implement klee_prefer_cex() and klee_abort() in Runtest and added corresponding tests + * add blockaddress and indirectbr instructions + * fix compilation warning + * exitOnError no output buf fix + * Change llvm apt repository to enable llvm 3.7+ + * Fix python2 linking + * doDumpStates: incorrectly increments stats + * [CMake] Add option to set GTest include dir + * fix test/Feature/BFSSearcherAndDFSSearcherInterleaved.c to use explicit enumeration of possible strings instead of CHECK-SAME (does not work as intended with LLVM >= 3.7) + * Store CexCache stats and then update klee-stats to use them + * Add missing endian information to avoid selecction of big endian systems + * Fail for aggegrations with big endian ordering + * Fixed handling of constant vectors with complex data + * Test complex constant data vectors as well + * Make print function of ObjectState public and const + * Add testcase for constant array handling + * Add test case for constant vector init + * Fix correct element order of InsertElement/ExtractElement + * Fix getelementptr for array or vector indices + * Fix generation of expressions from constant sequential data + * Added comment for getPointerWidth + * llvm50: use auto variable instead of SwitchInst::CaseIt + * Enable caching for travis-ci + * Fix coverage generation + * MergeHandler: remove unused closedStateCount + * add wllvm to the python packages to be installed + * [Travis-CI] Added codecov.io support +- Dropped patches (they are in upstream already): + * 0001-MergeHandler-remove-unused-closedStateCount.patch + * 0002-llvm50-use-auto-variable-instead-of-SwitchInst-CaseI.patch + * 0001-Fix-generation-of-expressions-from-constant-sequenti.patch + * 0002-Fix-getelementptr-for-array-or-vector-indices.patch + * 0003-Fix-correct-element-order-of-InsertElement-ExtractEl.patch + * 0004-Provide-errno-independent-of-CTYPE_EXTERNALS-being-d.patch + * 0005-Track-errno-correctly.patch + * 0006-Declare-klee_get_errno-and-remove-local-declarations.patch + * 0007-Add-support-for-modelling-errno_location.patch + * 0008-Cleanup-test-cases.patch + * 0009-test-fix-Feature-BFSSearcherAndDFSSearcherInterleave.patch + +------------------------------------------------------------------- Old: ---- 0001-Fix-generation-of-expressions-from-constant-sequenti.patch 0001-MergeHandler-remove-unused-closedStateCount.patch 0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch 0002-Fix-getelementptr-for-array-or-vector-indices.patch 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch 0002-llvm50-use-auto-variable-instead-of-SwitchInst-CaseI.patch 0003-Fix-correct-element-order-of-InsertElement-ExtractEl.patch 0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch 0004-Provide-errno-independent-of-CTYPE_EXTERNALS-being-d.patch 0004-llvm37-handle-getRegisteredOptions.patch 0005-Track-errno-correctly.patch 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch 0006-Declare-klee_get_errno-and-remove-local-declarations.patch 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch 0007-Add-support-for-modelling-errno_location.patch 0007-llvm38-test-change-some-tests.patch 0008-Cleanup-test-cases.patch 0008-llvm40-handle-different-header-names.patch 0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch 0009-test-fix-Feature-BFSSearcherAndDFSSearcherInterleave.patch 0010-llvm40-errorOr-and-similar.patch 0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch 0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch 0013-llvm40-gep_type_iterator-has-no-operator.patch 0014-llvm50-avoid-on-function-arg_begin.patch 0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch 0016-llvm50-handle-getOrInsertFunction-terminator.patch 0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch 0018-llvm50-handle-new-file_magic-s-location.patch 0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch 0020-llvm50-AllocaInst-takes-address-space.patch klee-1.4.0+20180108.tar.xz New: ---- 0001-llvm-make-KLEE-compile-against-LLVM-3.8.patch 0002-llvm38-test-change-some-tests.patch 0003-llvm-make-KLEE-compile-against-LLVM-3.9.patch 0004-llvm40-handle-different-header-names.patch 0005-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch 0006-llvm40-errorOr-and-similar.patch 0007-llvm-use-chrono-helpers-from-LLVM-4.0.patch 0008-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch 0009-llvm40-gep_type_iterator-has-no-operator.patch 0010-llvm50-avoid-on-function-arg_begin.patch 0011-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch 0012-llvm50-handle-getOrInsertFunction-terminator.patch 0013-llvm50-SwitchInst-case-functions-now-return-pointers.patch 0014-llvm50-handle-new-file_magic-s-location.patch 0015-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch 0016-llvm50-AllocaInst-takes-address-space.patch 0017-llvm50-Intrinsic-objectsize-has-three-arguments.patch 0018-llvm50-test-change-objectsize.patch 0019-llvm60-SetVersionPrinter-now-passes-down-a-stream.patch 0020-llvm60-handle-headers-renaming.patch klee-1.4.0+20180524.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ klee.spec ++++++ --- /var/tmp/diff_new_pack.woXPVC/_old 2018-05-30 12:29:51.588805505 +0200 +++ /var/tmp/diff_new_pack.woXPVC/_new 2018-05-30 12:29:51.596805212 +0200 @@ -19,7 +19,7 @@ %define llvm_version_minor 0 %define llvm_version %{llvm_version_major} -%define version_unconverted 1.4.0+20180108 +%define version_unconverted 1.4.0+20180524 %ifarch %{ix86} x86_64 %define with_uclibc 1 @@ -31,7 +31,7 @@ Summary: LLVM Execution Engine License: NCSA Group: Development/Languages/Other -Version: 1.4.0+20180108 +Version: 1.4.0+20180524 Release: 0 Url: http://klee.github.io/ Source0: %{name}-%{version}.tar.xz @@ -39,39 +39,26 @@ 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 -Patch1: 0001-MergeHandler-remove-unused-closedStateCount.patch -Patch2: 0002-llvm50-use-auto-variable-instead-of-SwitchInst-CaseI.patch - -Patch101: 0001-Fix-generation-of-expressions-from-constant-sequenti.patch -Patch102: 0002-Fix-getelementptr-for-array-or-vector-indices.patch -Patch103: 0003-Fix-correct-element-order-of-InsertElement-ExtractEl.patch -Patch104: 0004-Provide-errno-independent-of-CTYPE_EXTERNALS-being-d.patch -Patch105: 0005-Track-errno-correctly.patch -Patch106: 0006-Declare-klee_get_errno-and-remove-local-declarations.patch -Patch107: 0007-Add-support-for-modelling-errno_location.patch -Patch108: 0008-Cleanup-test-cases.patch -Patch109: 0009-test-fix-Feature-BFSSearcherAndDFSSearcherInterleave.patch - -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 +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 @@ -100,18 +87,6 @@ %prep %setup -q -%patch1 -p1 -%patch2 -p1 - -%patch101 -p1 -%patch102 -p1 -%patch103 -p1 -%patch104 -p1 -%patch105 -p1 -%patch106 -p1 -%patch107 -p1 -%patch108 -p1 -%patch109 -p1 %patch201 -p1 %patch202 -p1 @@ -134,7 +109,7 @@ %patch219 -p1 %patch220 -p1 -%patch300 -p1 +#%%patch300 -p1 mkdir -p build/test/ cp %{SOURCE2} build/test/ ++++++ 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch -> 0001-llvm-make-KLEE-compile-against-LLVM-3.8.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch 2018-01-31 19:53:55.939783398 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0001-llvm-make-KLEE-compile-against-LLVM-3.8.patch 2018-05-30 12:29:50.564843026 +0200 @@ -1,177 +1,270 @@ From: =?UTF-8?q?Richard=20Trembeck=C3=BD?= <[email protected]> -Date: Thu, 28 Apr 2016 18:27:24 +0200 -Subject: llvm: make KLEE compile against LLVM 3.7 +Date: Wed, 4 May 2016 15:21:45 +0200 +Subject: llvm: make KLEE compile against LLVM 3.8 Patch-mainline: no Signed-off-by: Jiri Slaby <[email protected]> --- - include/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(-) + lib/Core/Executor.cpp | 5 +++++ + lib/Core/StatsTracker.cpp | 4 ++++ + lib/Module/IntrinsicCleaner.cpp | 10 ++++++++- + lib/Module/LowerSwitch.cpp | 8 +++++++ + lib/Module/ModuleUtil.cpp | 39 ++++++++++++++++++++++++++++----- + lib/Module/Optimize.cpp | 13 ++++++++++- + tools/klee/main.cpp | 7 +++++- + 7 files changed, 77 insertions(+), 9 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)); +diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp +index f0781e5b882a..2c7e8d4d52a6 100644 +--- a/lib/Core/Executor.cpp ++++ b/lib/Core/Executor.cpp +@@ -2210,8 +2210,13 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { + !fpWidthToSemantics(right->getWidth())) + return terminateStateOnExecError(state, "Unsupported FRem operation"); + llvm::APFloat Res(*fpWidthToSemantics(left->getWidth()), left->getAPValue()); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ Res.mod( ++ APFloat(*fpWidthToSemantics(right->getWidth()), right->getAPValue())); +#else - case FLT_BITS: return llvm::IsNAN( UInt64AsFloat(l) ); - case DBL_BITS: return llvm::IsNAN( UInt64AsDouble(l) ); + Res.mod(APFloat(*fpWidthToSemantics(right->getWidth()),right->getAPValue()), + APFloat::rmNearestTiesToEven); +#endif - default: llvm::report_fatal_error("unsupported floating point width"); + bindLocal(ki, state, ConstantExpr::alloc(Res.bitcastToAPInt())); + break; } - } -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(); +diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp +index f2a989e28439..7881f0e84be5 100644 +--- a/lib/Core/StatsTracker.cpp ++++ b/lib/Core/StatsTracker.cpp +@@ -637,7 +637,11 @@ static std::vector<Instruction*> getSuccs(Instruction *i) { + for (succ_iterator it = succ_begin(bb), ie = succ_end(bb); it != ie; ++it) + res.push_back(&*(it->begin())); + } else { ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ res.push_back(&*(++(i->getIterator()))); ++#else + res.push_back(&*(++BasicBlock::iterator(i))); +#endif - return true; } + return res; +diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp +index 3729ff82cd9d..e10e886e8915 100644 +--- a/lib/Module/IntrinsicCleaner.cpp ++++ b/lib/Module/IntrinsicCleaner.cpp +@@ -50,6 +50,10 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { + unsigned WordSize = DataLayout.getPointerSizeInBits() / 8; + for (BasicBlock::iterator i = b.begin(), ie = b.end(); i != ie;) { + IntrinsicInst *ii = dyn_cast<IntrinsicInst>(&*i); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ // create a copy of iterator to pass to IRBuilder ctor later ++ BasicBlock::iterator i_ = i; ++#endif + // increment now since deletion of instructions makes iterator invalid. + ++i; + if (ii) { +@@ -110,8 +114,12 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { + case Intrinsic::uadd_with_overflow: + case Intrinsic::usub_with_overflow: + case Intrinsic::umul_with_overflow: { ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ // ctor needs the iterator, but we already increased ours ++ IRBuilder<> builder(ii->getParent(), i_); ++#else + IRBuilder<> builder(ii->getParent(), ii); +- ++#endif + Value *op1 = ii->getArgOperand(0); + Value *op2 = ii->getArgOperand(1); + +diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp +index 0f4e8b1eb72b..056885219e85 100644 +--- a/lib/Module/LowerSwitch.cpp ++++ b/lib/Module/LowerSwitch.cpp +@@ -64,7 +64,11 @@ void LowerSwitchPass::switchConvert(CaseItr begin, CaseItr end, + // iterate through all the cases, creating a new BasicBlock for each + for (CaseItr it = begin; it < end; ++it) { + BasicBlock *newBlock = BasicBlock::Create(F->getContext(), "NodeBlock"); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ Function::iterator FI = origBlock->getIterator(); ++#else + Function::iterator FI = origBlock; ++#endif + F->getBasicBlockList().insert(++FI, newBlock); + + ICmpInst *cmpInst = +@@ -101,7 +105,11 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) { + // if-then statements go to this and the PHI nodes are happy. + BasicBlock* newDefault = BasicBlock::Create(F->getContext(), "newDefault"); + ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ F->getBasicBlockList().insert(defaultBlock->getIterator(), newDefault); ++#else + F->getBasicBlockList().insert(defaultBlock, newDefault); ++#endif + BranchInst::Create(defaultBlock, newDefault); + + // If there is an entry in any PHI nodes for the default edge, make sure diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp -index a86adc98a1b1..b07d3d2fe348 100644 +index b07d3d2fe348..e6d592b135b6 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 +@@ -207,8 +207,19 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + + StringRef memberName; #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(); +- ErrorOr<StringRef> memberNameErr = AI->getName(); +- std::error_code ec = memberNameErr.getError(); ++ std::error_code ec; ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ ErrorOr<object::Archive::Child> childErr = *AI; ++ ec = childErr.getError(); ++ if (ec) { ++ errorMessage = ec.message(); ++ return false; ++ } +#else - Result = resultErr.get(); ++ object::Archive::child_iterator childErr = AI; +#endif ++ ErrorOr<StringRef> memberNameErr = childErr->getName(); ++ ec = memberNameErr.getError(); + if (!ec) { + memberName = memberNameErr.get(); #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; +@@ -226,7 +237,8 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + } + #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(); +- ErrorOr<std::unique_ptr<llvm::object::Binary> > child = AI->getAsBinary(); ++ ErrorOr<std::unique_ptr<llvm::object::Binary> > child = ++ childErr->getAsBinary(); + ec = child.getError(); #else -@@ -432,7 +445,9 @@ Module *klee::linkWithLibrary(Module *module, - ErrorMessage.c_str()); - } + OwningPtr<object::Binary> child; +@@ -235,7 +247,7 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + if (ec) { + // If we can't open as a binary object file its hopefully a bitcode file + #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) +- ErrorOr<MemoryBufferRef> buff = AI->getMemoryBufferRef(); ++ ErrorOr<MemoryBufferRef> buff = childErr->getMemoryBufferRef(); + ec = buff.getError(); + #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) + ErrorOr<std::unique_ptr<MemoryBuffer> > buffErr = AI->getMemoryBuffer(); +@@ -343,7 +355,9 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Found " << GV->getName() << + " in " << M->getModuleIdentifier() << "\n"); --#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 +-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ if (Linker::linkModules(*composite, std::unique_ptr<Module>(M))) ++#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) + if (Linker::LinkModules(composite, M)) + #else + if (Linker::LinkModules(composite, M, Linker::DestroySource, &errorMessage)) +@@ -360,8 +374,10 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + // Link succeed, now clean up + modulesLoadedOnPass++; + KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Linking succeeded.\n"); +- ++// M was owned by linkModules function ++#if LLVM_VERSION_CODE < LLVM_VERSION(3, 8) + delete M; ++#endif + archiveModules[i] = 0; -@@ -446,7 +461,10 @@ Module *klee::linkWithLibrary(Module *module, - ErrorMessage.c_str()); - } + // We need to recompute the undefined symbols in the composite module +@@ -427,7 +443,9 @@ Module *klee::linkWithLibrary(Module *module, + std::string ErrorMessage; -+// unique_ptr owns the Module, we don't have to delete it -+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 7) - delete Result; + if (magic == sys::fs::file_magic::bitcode) { ++#if LLVM_VERSION_CODE < LLVM_VERSION(3, 8) + Module *Result = 0; +#endif + #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) + #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) + ErrorOr<std::unique_ptr<Module> > ResultErr = +@@ -445,6 +463,10 @@ Module *klee::linkWithLibrary(Module *module, + ErrorMessage.c_str()); + } - } 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(); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ if (Linker::linkModules(*module, std::move(ResultErr.get()))) { ++ ErrorMessage = "linking error"; +#else - auto module = *errorOrModule; + #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) + Result = ResultErr->release(); + #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) +@@ -456,6 +478,7 @@ Module *klee::linkWithLibrary(Module *module, + ErrorMessage = "linking error"; + #else + if (Linker::LinkModules(module, Result, Linker::DestroySource, &ErrorMessage)) { +#endif + #endif + klee_error("Link with library %s failed: %s", libraryName.c_str(), + ErrorMessage.c_str()); +@@ -639,7 +662,11 @@ Module *klee::loadModule(LLVMContext &ctx, const std::string &path, std::string + auto module = *errorOrModule; + #endif ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ if (auto ec = module->materializeAll()) { ++#else if (auto ec = module->materializeAllPermanently()) { ++#endif errorMsg = ec.message(); + return nullptr; + } diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp -index 02ab446a8d63..64e4863f70b3 100644 +index 64e4863f70b3..944f51ef336d 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()); +@@ -102,7 +102,12 @@ static void AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) { + addPass(PM, createCFGSimplificationPass()); // Clean up after IPCP & DAE - // 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 + addPass(PM, createPruneEHPass()); // Remove dead EH info +- addPass(PM, createFunctionAttrsPass()); // Deduce function attrs ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ addPass(PM, createPostOrderFunctionAttrsPass()); ++ addPass(PM, createReversePostOrderFunctionAttrsPass()); ++#else ++ addPass(PM, createFunctionAttrsPass()); // Deduce function attrs ++#endif + + if (!DisableInline) + addPass(PM, createFunctionInliningPass()); // Inline small functions +@@ -217,8 +222,14 @@ void Optimize(Module *M, const std::string &EntryPoint) { + addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas + + // Run a few AA driven optimizations here and now, to cleanup the code. ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++ addPass(Passes, createPostOrderFunctionAttrsPass()); ++ addPass(Passes, createReversePostOrderFunctionAttrsPass()); ++ // addPass(Passes, createGlobalsAAWrapperPass()); ++#else + addPass(Passes, createFunctionAttrsPass()); // Add nocapture + addPass(Passes, createGlobalsModRefPass()); // IP alias analysis ++#endif + + addPass(Passes, createLICMPass()); // Hoist loop invariants + addPass(Passes, createGVNPass()); // Remove redundancies diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp -index 9bdf06f600ce..ea24d89c5aaf 100644 +index ab9dfe286ffb..3d73ae07fcb5 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" +@@ -291,7 +291,12 @@ KleeHandler::KleeHandler(int argc, char **argv) + for (; i <= INT_MAX; ++i) { + SmallString<128> d(directory); + llvm::sys::path::append(d, "klee-out-"); +- raw_svector_ostream ds(d); ds << i; ds.flush(); ++ raw_svector_ostream ds(d); ++ ds << i; ++// SmallString is always up-to-date, no need to flush. See Support/raw_ostream.h ++#if LLVM_VERSION_CODE < LLVM_VERSION(3, 8) ++ ds.flush(); ++#endif - #include "llvm/Support/TargetSelect.h" + // create directory and try to link klee-last + if (mkdir(d.c_str(), 0775) == 0) { -- -2.15.1 +2.17.0 ++++++ 0007-llvm38-test-change-some-tests.patch -> 0002-llvm38-test-change-some-tests.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0007-llvm38-test-change-some-tests.patch 2018-01-31 19:53:56.895738942 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0002-llvm38-test-change-some-tests.patch 2018-05-30 12:29:50.576842587 +0200 @@ -3,36 +3,31 @@ Subject: llvm38: test, change some tests Patch-mainline: no -alias in LLVM 3.8 has a new format, it adds a AliaseeTy parameter. So +alias in LLVM 3.8 has a new format, it adds an AliaseeTy parameter. So handle this in the tests. +[v2] add comments about what was changed and why + Signed-off-by: Jiri Slaby <[email protected]> --- - test/Feature/BitcastAlias.llvm37.ll | 1 + - test/Feature/BitcastAlias.llvm38.ll | 35 +++++++++++++++++++++++++++++++++ - test/Feature/BitcastAliasMD2U.llvm37.ll | 1 + - test/Feature/BitcastAliasMD2U.llvm38.ll | 35 +++++++++++++++++++++++++++++++++ - 4 files changed, 72 insertions(+) - create mode 100644 test/Feature/BitcastAlias.llvm38.ll - create mode 100644 test/Feature/BitcastAliasMD2U.llvm38.ll + test/Feature/BitcastAlias.leq37.ll | 38 ++++++++++++++++++++++++++ + test/Feature/BitcastAlias.ll | 5 ++-- + test/Feature/BitcastAliasMD2U.leq37.ll | 38 ++++++++++++++++++++++++++ + test/Feature/BitcastAliasMD2U.ll | 5 ++-- + 4 files changed, 82 insertions(+), 4 deletions(-) + create mode 100644 test/Feature/BitcastAlias.leq37.ll + create mode 100644 test/Feature/BitcastAliasMD2U.leq37.ll -diff --git a/test/Feature/BitcastAlias.llvm37.ll b/test/Feature/BitcastAlias.llvm37.ll -index 0d6e72604d6b..3b702ba2a6b0 100644 ---- a/test/Feature/BitcastAlias.llvm37.ll -+++ b/test/Feature/BitcastAlias.llvm37.ll -@@ -1,4 +1,5 @@ - ; REQUIRES: geq-llvm-3.7 -+; REQUIRES: lt-llvm-3.8 - ; RUN: llvm-as %s -f -o %t1.bc - ; RUN: rm -rf %t.klee-out - ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2 -diff --git a/test/Feature/BitcastAlias.llvm38.ll b/test/Feature/BitcastAlias.llvm38.ll +diff --git a/test/Feature/BitcastAlias.leq37.ll b/test/Feature/BitcastAlias.leq37.ll new file mode 100644 -index 000000000000..ff7009b7711b +index 000000000000..e860acb24594 --- /dev/null -+++ b/test/Feature/BitcastAlias.llvm38.ll -@@ -0,0 +1,35 @@ -+; REQUIRES: geq-llvm-3.8 ++++ b/test/Feature/BitcastAlias.leq37.ll +@@ -0,0 +1,38 @@ ++; LLVM 3.7 requires a type as the first argument to 'getelementptr' ++; LLVM 3.7 no longer accepts '*' with a 'call' ++; REQUIRES: geq-llvm-3.7 ++; REQUIRES: lt-llvm-3.8 +; RUN: llvm-as %s -f -o %t1.bc +; RUN: rm -rf %t.klee-out +; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2 @@ -41,7 +36,7 @@ +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" +target triple = "x86_64-unknown-linux-gnu" + -+@foo = alias i32 (i32), i32 (i32)* @__foo ++@foo = alias i32 (i32)* @__foo + +define i32 @__foo(i32 %i) nounwind { +entry: @@ -67,23 +62,38 @@ + %1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.failstr, i64 0, i64 0)) nounwind + ret i32 0 +} -diff --git a/test/Feature/BitcastAliasMD2U.llvm37.ll b/test/Feature/BitcastAliasMD2U.llvm37.ll -index 12abf09373f8..2332a1968dea 100644 ---- a/test/Feature/BitcastAliasMD2U.llvm37.ll -+++ b/test/Feature/BitcastAliasMD2U.llvm37.ll -@@ -1,4 +1,5 @@ - ; REQUIRES: geq-llvm-3.7 -+; REQUIRES: lt-llvm-3.8 +diff --git a/test/Feature/BitcastAlias.ll b/test/Feature/BitcastAlias.ll +index 5bd301936e13..5111f18e53aa 100644 +--- a/test/Feature/BitcastAlias.ll ++++ b/test/Feature/BitcastAlias.ll +@@ -1,6 +1,7 @@ ++; LLVM 3.8 requires a type as the first argument to 'alias' + ; LLVM 3.7 requires a type as the first argument to 'getelementptr' + ; LLVM 3.7 no longer accepts '*' with a 'call' +-; REQUIRES: geq-llvm-3.7 ++; REQUIRES: geq-llvm-3.8 ; RUN: llvm-as %s -f -o %t1.bc ; RUN: rm -rf %t.klee-out - ; RUN: %klee --output-dir=%t.klee-out -disable-opt -search=nurs:md2u %t1.bc > %t2 -diff --git a/test/Feature/BitcastAliasMD2U.llvm38.ll b/test/Feature/BitcastAliasMD2U.llvm38.ll + ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc > %t2 +@@ -9,7 +10,7 @@ + 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" + target triple = "x86_64-unknown-linux-gnu" + +-@foo = alias i32 (i32)* @__foo ++@foo = alias i32 (i32), i32 (i32)* @__foo + + define i32 @__foo(i32 %i) nounwind { + entry: +diff --git a/test/Feature/BitcastAliasMD2U.leq37.ll b/test/Feature/BitcastAliasMD2U.leq37.ll new file mode 100644 -index 000000000000..f4e41293c347 +index 000000000000..c29ec8a62243 --- /dev/null -+++ b/test/Feature/BitcastAliasMD2U.llvm38.ll -@@ -0,0 +1,35 @@ -+; REQUIRES: geq-llvm-3.8 ++++ b/test/Feature/BitcastAliasMD2U.leq37.ll +@@ -0,0 +1,38 @@ ++; LLVM 3.7 requires a type as the first argument to 'getelementptr' ++; LLVM 3.7 no longer accepts '*' with a 'call' ++; REQUIRES: geq-llvm-3.7 ++; REQUIRES: lt-llvm-3.8 +; RUN: llvm-as %s -f -o %t1.bc +; RUN: rm -rf %t.klee-out +; RUN: %klee --output-dir=%t.klee-out -disable-opt -search=nurs:md2u %t1.bc > %t2 @@ -92,7 +102,7 @@ +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" +target triple = "x86_64-unknown-linux-gnu" + -+@foo = alias i32 (i32), i32 (i32)* @__foo ++@foo = alias i32 (i32)* @__foo + +define i32 @__foo(i32 %i) nounwind { +entry: @@ -118,6 +128,28 @@ + %1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.failstr, i64 0, i64 0)) nounwind + ret i32 0 +} +diff --git a/test/Feature/BitcastAliasMD2U.ll b/test/Feature/BitcastAliasMD2U.ll +index 7eddd3d6a01c..7ef74a8da43c 100644 +--- a/test/Feature/BitcastAliasMD2U.ll ++++ b/test/Feature/BitcastAliasMD2U.ll +@@ -1,6 +1,7 @@ ++; LLVM 3.8 requires a type as the first argument to 'alias' + ; LLVM 3.7 requires a type as the first argument to 'getelementptr' + ; LLVM 3.7 no longer accepts '*' with a 'call' +-; REQUIRES: geq-llvm-3.7 ++; REQUIRES: geq-llvm-3.8 + ; RUN: llvm-as %s -f -o %t1.bc + ; RUN: rm -rf %t.klee-out + ; RUN: %klee --output-dir=%t.klee-out -disable-opt -search=nurs:md2u %t1.bc > %t2 +@@ -9,7 +10,7 @@ + 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" + target triple = "x86_64-unknown-linux-gnu" + +-@foo = alias i32 (i32)* @__foo ++@foo = alias i32 (i32), i32 (i32)* @__foo + + define i32 @__foo(i32 %i) nounwind { + entry: -- -2.15.1 +2.17.0 ++++++ 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch -> 0003-llvm-make-KLEE-compile-against-LLVM-3.9.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch 2018-01-31 19:53:55.939783398 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0003-llvm-make-KLEE-compile-against-LLVM-3.9.patch 2018-05-30 12:29:50.592842001 +0200 @@ -1,177 +1,292 @@ -From: =?UTF-8?q?Richard=20Trembeck=C3=BD?= <[email protected]> -Date: Thu, 28 Apr 2016 18:27:24 +0200 -Subject: llvm: make KLEE compile against LLVM 3.7 +From: Jiri Slaby <[email protected]> +Date: Wed, 22 Feb 2017 15:57:55 +0100 +Subject: llvm: make KLEE compile against LLVM 3.9 Patch-mainline: no Signed-off-by: Jiri Slaby <[email protected]> --- - include/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(-) + lib/Core/Executor.cpp | 16 ++++++++++++++++ + lib/Core/MemoryManager.cpp | 5 ++++- + lib/Module/ModuleUtil.cpp | 36 +++++++++++++++++++++++++++++++++--- + lib/Module/Optimize.cpp | 28 ++++++++++++++++++++++++++++ + lib/Module/RaiseAsm.cpp | 10 +++++++++- + tools/kleaver/main.cpp | 4 ++++ + tools/klee/main.cpp | 4 ++++ + 7 files changed, 98 insertions(+), 5 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)); +diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp +index 2c7e8d4d52a6..b2178cccefd2 100644 +--- a/lib/Core/Executor.cpp ++++ b/lib/Core/Executor.cpp +@@ -1305,10 +1305,18 @@ void Executor::executeCall(ExecutionState &state, + // + // Alignment requirements for scalar types is the same as their size + if (argWidth > Expr::Int64) { ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ size = llvm::alignTo(size, 16); +#else - case FLT_BITS: return llvm::IsNAN( UInt64AsFloat(l) ); - case DBL_BITS: return llvm::IsNAN( UInt64AsDouble(l) ); + size = llvm::RoundUpToAlignment(size, 16); +#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(); + requires16ByteAlignment = true; + } ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ size += llvm::alignTo(argWidth, WordSize) / 8; ++#else + size += llvm::RoundUpToAlignment(argWidth, WordSize) / 8; ++#endif + } + } + +@@ -1341,10 +1349,18 @@ void Executor::executeCall(ExecutionState &state, + + Expr::Width argWidth = arguments[i]->getWidth(); + if (argWidth > Expr::Int64) { ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ offset = llvm::alignTo(offset, 16); ++#else + offset = llvm::RoundUpToAlignment(offset, 16); ++#endif + } + os->write(offset, arguments[i]); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ offset += llvm::alignTo(argWidth, WordSize) / 8; ++#else + offset += llvm::RoundUpToAlignment(argWidth, WordSize) / 8; ++#endif + } + } + } +diff --git a/lib/Core/MemoryManager.cpp b/lib/Core/MemoryManager.cpp +index 24e2ed97581f..f40e8bc9deb8 100644 +--- a/lib/Core/MemoryManager.cpp ++++ b/lib/Core/MemoryManager.cpp +@@ -111,9 +111,12 @@ MemoryObject *MemoryManager::allocate(uint64_t size, bool isLocal, + + uint64_t address = 0; + if (DeterministicAllocation) { +- ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ address = llvm::alignTo((uint64_t)nextFreeSlot + alignment - 1, alignment); ++#else + address = llvm::RoundUpToAlignment((uint64_t)nextFreeSlot + alignment - 1, + alignment); +#endif - return true; - } + // Handle the case of 0-sized allocations as 1-byte allocations. + // This way, we make sure we have this allocation between its own red zones diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp -index a86adc98a1b1..b07d3d2fe348 100644 +index e6d592b135b6..ee4af254dae2 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(); +@@ -196,7 +196,11 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + + KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Loading modules\n"); + // Load all bitcode files in to memory so we can examine their symbols +-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ Error Err; ++ for (object::Archive::child_iterator AI = archive->child_begin(Err), ++ AE = archive->child_end(); AI != AE; ++AI) ++#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) + for (object::Archive::child_iterator AI = archive->child_begin(), + AE = archive->child_end(); AI != AE; ++AI) #else -@@ -432,7 +445,9 @@ Module *klee::linkWithLibrary(Module *module, - ErrorMessage.c_str()); +@@ -236,7 +240,17 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er + return false; } -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) -+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) -+ Result = ResultErr->release(); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ Expected<std::unique_ptr<llvm::object::Binary> > child = ++ childErr->getAsBinary(); ++ if (!child) { ++ // I don't know why, but ++ // ec = errorToErrorCode(child.takeError()) ++ // does not work here, so: ++ consumeError(child.takeError()); ++ ec = std::make_error_code(std::errc::io_error); ++ } +#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) - Result = ResultErr.get(); - #endif - -@@ -446,7 +461,10 @@ Module *klee::linkWithLibrary(Module *module, - ErrorMessage.c_str()); + ErrorOr<std::unique_ptr<llvm::object::Binary> > child = + childErr->getAsBinary(); + ec = child.getError(); +@@ -319,6 +333,13 @@ static bool linkBCA(object::Archive* archive, Module* composite, std::string& er } -+// unique_ptr owns the Module, we don't have to delete it -+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 7) - delete Result; + } ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ if (Err) { ++ SS << "Cannot iterate over archive"; ++ SS.flush(); ++ return false; ++ } +#endif + KLEE_DEBUG_WITH_TYPE("klee_linker", dbgs() << "Loaded " << archiveModules.size() << " modules\n"); + +@@ -490,7 +511,12 @@ Module *klee::linkWithLibrary(Module *module, + #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(); +-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ Expected<std::unique_ptr<object::Binary> > arch = ++ object::createBinary(Buffer, &Context); ++ if (!arch) ++ ec = errorToErrorCode(arch.takeError()); ++#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) + ErrorOr<std::unique_ptr<object::Binary> > arch = + object::createBinary(Buffer, &Context); + ec = arch.getError(); +@@ -548,7 +574,11 @@ Function *klee::getDirectCallTarget(CallSite cs, bool moduleIsFullyLinked) { + if (Function *f = dyn_cast<Function>(v)) { + return f; + } else if (llvm::GlobalAlias *ga = dyn_cast<GlobalAlias>(v)) { ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ if (moduleIsFullyLinked || !(ga->isInterposable())) { +#else - auto module = *errorOrModule; + if (moduleIsFullyLinked || !(ga->mayBeOverridden())) { +#endif - - if (auto ec = module->materializeAllPermanently()) { - errorMsg = ec.message(); + v = ga->getAliasee(); + } else { + v = NULL; diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp -index 02ab446a8d63..64e4863f70b3 100644 +index 944f51ef336d..ae1d4839f772 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()); +@@ -35,6 +35,11 @@ + #include "llvm/Analysis/Verifier.h" + #endif - // 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); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++#include "llvm/Transforms/IPO/FunctionAttrs.h" ++#include "llvm/Transforms/Scalar/GVN.h" ++#endif ++ + using namespace llvm; + + // Don't verify at the end +@@ -103,7 +108,11 @@ static void AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) { + + addPass(PM, createPruneEHPass()); // Remove dead EH info + #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ addPass(PM, createPostOrderFunctionAttrsLegacyPass()); ++#else + addPass(PM, createPostOrderFunctionAttrsPass()); ++#endif + addPass(PM, createReversePostOrderFunctionAttrsPass()); + #else + addPass(PM, createFunctionAttrsPass()); // Deduce function attrs +@@ -116,7 +125,11 @@ static void AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) { + addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl. + addPass(PM, createJumpThreadingPass()); // Thread jumps. + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ addPass(PM, createSROAPass()); // Break up aggregate allocas ++#else + addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas ++#endif + addPass(PM, createInstructionCombiningPass()); // Combine silly seq's + + addPass(PM, createTailCallEliminationPass()); // Eliminate tail calls +@@ -179,8 +192,15 @@ void Optimize(Module *M, const std::string &EntryPoint) { + // for a main function. If main is defined, mark all other functions + // internal. + if (!DisableInternalize) { ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ auto PreserveEP = [=](const GlobalValue &GV) { ++ return GV.getName().equals(EntryPoint); ++ }; ++ ModulePass *pass = createInternalizePass(PreserveEP); ++#else + ModulePass *pass = createInternalizePass( + std::vector<const char *>(1, EntryPoint.c_str())); ++#endif + addPass(Passes, pass); + } + +@@ -219,11 +239,19 @@ void Optimize(Module *M, const std::string &EntryPoint) { + // The IPO passes may leave cruft around. Clean up after them. + addPass(Passes, createInstructionCombiningPass()); + addPass(Passes, createJumpThreadingPass()); // Thread jumps. ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ addPass(Passes, createSROAPass()); // Break up allocas ++#else + addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas ++#endif + + // Run a few AA driven optimizations here and now, to cleanup the code. + #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ addPass(Passes, createPostOrderFunctionAttrsLegacyPass()); ++#else + addPass(Passes, createPostOrderFunctionAttrsPass()); ++#endif + addPass(Passes, createReversePostOrderFunctionAttrsPass()); + // addPass(Passes, createGlobalsAAWrapperPass()); + #else diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp -index 13e4f7d47e58..c597fa2a7b82 100644 +index c597fa2a7b82..d9b3e40154ba 100644 --- a/lib/Module/RaiseAsm.cpp +++ b/lib/Module/RaiseAsm.cpp -@@ -81,7 +81,10 @@ bool RaiseAsmPass::runOnModule(Module &M) { +@@ -60,7 +60,11 @@ bool RaiseAsmPass::runOnInstruction(Module &M, Instruction *I) { + + if (ia->getAsmString() == "" && ia->hasSideEffects()) { + IRBuilder<> Builder(I); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent); ++#else + Builder.CreateFence(llvm::SequentiallyConsistent); ++#endif + I->eraseFromParent(); + return true; + } +@@ -81,7 +85,11 @@ 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()); +-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ TM = NativeTarget->createTargetMachine(HostTriple, "", "", TargetOptions(), ++ None); + TLI = TM->getSubtargetImpl(*(M.begin()))->getTargetLowering(); -+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) ++#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) TM = NativeTarget->createTargetMachine(HostTriple, "", "", TargetOptions()); - TLI = TM->getSubtargetImpl()->getTargetLowering(); - #else + TLI = TM->getSubtargetImpl(*(M.begin()))->getTargetLowering(); + #elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) +diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp +index b8b32e31264a..800cece95e9c 100644 +--- a/tools/kleaver/main.cpp ++++ b/tools/kleaver/main.cpp +@@ -400,7 +400,11 @@ static bool printInputAsSMTLIBv2(const char *Filename, + int main(int argc, char **argv) { + bool success = true; + ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); ++#else + llvm::sys::PrintStackTraceOnErrorSignal(); ++#endif + llvm::cl::SetVersionPrinter(klee::printVersion); + llvm::cl::ParseCommandLineOptions(argc, argv); + diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp -index 9bdf06f600ce..ea24d89c5aaf 100644 +index 3d73ae07fcb5..c0ea4fa54551 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" +@@ -1132,7 +1132,11 @@ int main(int argc, char **argv, char **envp) { + llvm::InitializeNativeTarget(); + + parseArguments(argc, argv); ++#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) ++ sys::PrintStackTraceOnErrorSignal(argv[0]); ++#else + sys::PrintStackTraceOnErrorSignal(); ++#endif - #include "llvm/Support/TargetSelect.h" + if (Watchdog) { + if (MaxTime==0) { -- -2.15.1 +2.17.0 ++++++ 0008-llvm40-handle-different-header-names.patch -> 0004-llvm40-handle-different-header-names.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0008-llvm40-handle-different-header-names.patch 2018-01-31 19:53:57.327718852 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0004-llvm40-handle-different-header-names.patch 2018-05-30 12:29:50.604841561 +0200 @@ -14,7 +14,7 @@ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp -index 0439431b3bc8..ff76cd53c895 100644 +index 75e71c0a557f..232cd88fd621 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -21,7 +21,11 @@ @@ -59,7 +59,7 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Path.h" diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp -index 436651f438d4..07f302a4641f 100644 +index c0ea4fa54551..154a76feb361 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -31,7 +31,6 @@ @@ -84,5 +84,5 @@ #include <signal.h> #include <unistd.h> -- -2.15.1 +2.17.0 ++++++ 0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch -> 0005-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch 2018-01-31 19:53:57.403715318 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0005-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch 2018-05-30 12:29:50.616841121 +0200 @@ -9,10 +9,10 @@ 1 file changed, 9 insertions(+) diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp -index d7c3194d9de4..19499e1be37d 100644 +index b2178cccefd2..75132e0db71b 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp -@@ -1451,12 +1451,21 @@ static bool isDebugIntrinsic(const Function *f, KModule *KM) { +@@ -1448,12 +1448,21 @@ static bool isDebugIntrinsic(const Function *f, KModule *KM) { static inline const llvm::fltSemantics * fpWidthToSemantics(unsigned width) { switch(width) { @@ -35,5 +35,5 @@ return 0; } -- -2.15.1 +2.17.0 ++++++ 0010-llvm40-errorOr-and-similar.patch -> 0006-llvm40-errorOr-and-similar.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0010-llvm40-errorOr-and-similar.patch 2018-01-31 19:53:57.455712900 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0006-llvm40-errorOr-and-similar.patch 2018-05-30 12:29:50.628840682 +0200 @@ -5,7 +5,7 @@ Signed-off-by: Jiri Slaby <[email protected]> --- - lib/Module/ModuleUtil.cpp | 50 ++++++++++++++++++++++++++++++++++++++--------- + lib/Module/ModuleUtil.cpp | 50 ++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp @@ -124,5 +124,5 @@ #else if (auto ec = module->materializeAllPermanently()) { -- -2.15.1 +2.17.0 ++++++ 0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch -> 0007-llvm-use-chrono-helpers-from-LLVM-4.0.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch 2018-01-31 19:53:57.475711970 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0007-llvm-use-chrono-helpers-from-LLVM-4.0.patch 2018-05-30 12:29:50.640840242 +0200 @@ -8,11 +8,11 @@ Signed-off-by: Jiri Slaby <[email protected]> --- - include/klee/Internal/Support/Timer.h | 8 ++++++++ - include/klee/Internal/System/Time.h | 11 +++++++++++ - lib/Core/StatsTracker.cpp | 24 ++++++++++++++++++++++++ - lib/Support/Time.cpp | 32 ++++++++++++++++++++++++++++++++ - lib/Support/Timer.cpp | 16 ++++++++++++++++ + include/klee/Internal/Support/Timer.h | 8 +++++++ + include/klee/Internal/System/Time.h | 11 +++++++++ + lib/Core/StatsTracker.cpp | 24 ++++++++++++++++++++ + lib/Support/Time.cpp | 32 +++++++++++++++++++++++++++ + lib/Support/Timer.cpp | 16 ++++++++++++++ 5 files changed, 91 insertions(+) diff --git a/include/klee/Internal/Support/Timer.h b/include/klee/Internal/Support/Timer.h @@ -38,7 +38,7 @@ public: WallTimer(); diff --git a/include/klee/Internal/System/Time.h b/include/klee/Internal/System/Time.h -index 14d235364401..feeeed8affa2 100644 +index 220e260c975e..12522c866439 100644 --- a/include/klee/Internal/System/Time.h +++ b/include/klee/Internal/System/Time.h @@ -10,7 +10,13 @@ @@ -48,9 +48,9 @@ +#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0) +#include <chrono> + -+#include <llvm/Support/Chrono.h> ++#include "llvm/Support/Chrono.h" +#else - #include <llvm/Support/TimeValue.h> + #include "llvm/Support/TimeValue.h" +#endif namespace klee { @@ -69,10 +69,10 @@ } diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp -index e931dcef8b2e..c39c7d5bd7ba 100644 +index 7881f0e84be5..0be727fbc346 100644 --- a/lib/Core/StatsTracker.cpp +++ b/lib/Core/StatsTracker.cpp -@@ -282,6 +282,29 @@ void StatsTracker::done() { +@@ -286,6 +286,29 @@ void StatsTracker::done() { void StatsTracker::stepInstruction(ExecutionState &es) { if (OutputIStats) { if (TrackInstructionTime) { @@ -102,7 +102,7 @@ static sys::TimeValue lastNowTime(0,0),lastUserTime(0,0); if (lastUserTime.seconds()==0 && lastUserTime.nanoseconds()==0) { -@@ -297,6 +320,7 @@ void StatsTracker::stepInstruction(ExecutionState &es) { +@@ -301,6 +324,7 @@ void StatsTracker::stepInstruction(ExecutionState &es) { lastUserTime = user; lastNowTime = now; } @@ -195,5 +195,5 @@ + +#endif -- -2.15.1 +2.17.0 ++++++ 0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch -> 0008-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch 2018-01-31 19:53:57.503710668 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0008-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch 2018-05-30 12:29:50.652839802 +0200 @@ -8,7 +8,7 @@ Signed-off-by: Jiri Slaby <[email protected]> --- include/klee/util/GetElementPtrTypeIterator.h | 4 ++++ - lib/Core/Executor.cpp | 22 +++++++++++++++++++--- + lib/Core/Executor.cpp | 22 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/include/klee/util/GetElementPtrTypeIterator.h b/include/klee/util/GetElementPtrTypeIterator.h @@ -27,10 +27,10 @@ CurTy = 0; } diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp -index 19499e1be37d..093be697c7da 100644 +index 75132e0db71b..1c08870b7a20 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp -@@ -2522,8 +2522,7 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) { +@@ -2598,8 +2598,7 @@ 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())); @@ -40,7 +40,7 @@ uint64_t elementSize = kmodule->targetData->getTypeStoreSize(set->getElementType()); Value *operand = ii.getOperand(); -@@ -2537,7 +2536,24 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) { +@@ -2613,7 +2612,24 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) { } else { kgepi->indices.push_back(std::make_pair(index, elementSize)); } @@ -67,5 +67,5 @@ } kgepi->offset = constantOffset->getZExtValue(); -- -2.15.1 +2.17.0 ++++++ 0013-llvm40-gep_type_iterator-has-no-operator.patch -> 0009-llvm40-gep_type_iterator-has-no-operator.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0013-llvm40-gep_type_iterator-has-no-operator.patch 2018-01-31 19:53:57.519709924 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0009-llvm40-gep_type_iterator-has-no-operator.patch 2018-05-30 12:29:50.664839363 +0200 @@ -12,10 +12,10 @@ 1 file changed, 4 insertions(+) diff --git a/lib/Core/ExecutorUtil.cpp b/lib/Core/ExecutorUtil.cpp -index 92dee5ac3906..c9308795804e 100644 +index a352db3339c4..7718ae9d0ccb 100644 --- a/lib/Core/ExecutorUtil.cpp +++ b/lib/Core/ExecutorUtil.cpp -@@ -200,7 +200,11 @@ namespace klee { +@@ -213,7 +213,11 @@ namespace klee { continue; // Handle a struct index, which adds its field offset to the pointer. @@ -28,5 +28,5 @@ const StructLayout *SL = kmodule->targetData->getStructLayout(STy); base = base->Add( -- -2.15.1 +2.17.0 ++++++ 0014-llvm50-avoid-on-function-arg_begin.patch -> 0010-llvm50-avoid-on-function-arg_begin.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0014-llvm50-avoid-on-function-arg_begin.patch 2018-01-31 19:53:57.539708994 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0010-llvm50-avoid-on-function-arg_begin.patch 2018-05-30 12:29:50.676838923 +0200 @@ -18,7 +18,7 @@ 1 file changed, 8 insertions(+) diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp -index 07f302a4641f..aeed018631ea 100644 +index 154a76feb361..def83b584167 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -658,7 +658,11 @@ static int initEnv(Module *mainModule) { @@ -46,5 +46,5 @@ args.push_back(Constant::getNullValue(ft->getParamType(4))); // app_fini args.push_back(Constant::getNullValue(ft->getParamType(5))); // rtld_fini -- -2.15.1 +2.17.0 ++++++ 0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch -> 0011-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch 2018-01-31 19:53:57.563707877 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0011-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch 2018-05-30 12:29:50.688838483 +0200 @@ -28,5 +28,5 @@ } } -- -2.15.1 +2.17.0 ++++++ 0016-llvm50-handle-getOrInsertFunction-terminator.patch -> 0012-llvm50-handle-getOrInsertFunction-terminator.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0016-llvm50-handle-getOrInsertFunction-terminator.patch 2018-01-31 19:53:57.579707134 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0012-llvm50-handle-getOrInsertFunction-terminator.patch 2018-05-30 12:29:50.704837897 +0200 @@ -12,9 +12,9 @@ --- include/klee/Config/Version.h | 6 ++++++ lib/Module/Checks.cpp | 8 ++++---- - lib/Module/IntrinsicCleaner.cpp | 2 +- + lib/Module/IntrinsicCleaner.cpp | 3 ++- tools/klee/main.cpp | 20 ++++++++++---------- - 4 files changed, 21 insertions(+), 15 deletions(-) + 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h index 532051602fe3..a02ce28baaae 100644 @@ -58,20 +58,21 @@ } diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp -index 2b93319f2615..c00c77699e18 100644 +index e10e886e8915..d4f93bdc591e 100644 --- a/lib/Module/IntrinsicCleaner.cpp +++ b/lib/Module/IntrinsicCleaner.cpp -@@ -208,7 +208,7 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { +@@ -214,7 +214,8 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) { + // Intrisic 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)); -+ "abort", Type::getVoidTy(ctx) KLEE_LLVM_GOIF_TERMINATOR)); +- M.getOrInsertFunction("abort", Type::getVoidTy(ctx), NULL)); ++ M.getOrInsertFunction("abort", Type::getVoidTy(ctx) ++ KLEE_LLVM_GOIF_TERMINATOR)); F->setDoesNotReturn(); F->setDoesNotThrow(); diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp -index aeed018631ea..02748fbc0ee5 100644 +index def83b584167..ff87d210b863 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -678,8 +678,8 @@ static int initEnv(Module *mainModule) { @@ -115,5 +116,5 @@ f = mainModule->getFunction("__ctype_get_mb_cur_max"); -- -2.15.1 +2.17.0 ++++++ 0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch -> 0013-llvm50-SwitchInst-case-functions-now-return-pointers.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch 2018-01-31 19:53:57.615705459 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0013-llvm50-SwitchInst-case-functions-now-return-pointers.patch 2018-05-30 12:29:50.720837312 +0200 @@ -15,10 +15,10 @@ 1 file changed, 4 insertions(+) diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp -index 093be697c7da..5fe5bf9c1346 100644 +index 1c08870b7a20..ee6821b6dc18 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp -@@ -1571,7 +1571,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { +@@ -1641,7 +1641,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()); @@ -31,5 +31,5 @@ } else { // Handle possible different branch targets -- -2.15.1 +2.17.0 ++++++ 0018-llvm50-handle-new-file_magic-s-location.patch -> 0014-llvm50-handle-new-file_magic-s-location.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0018-llvm50-handle-new-file_magic-s-location.patch 2018-01-31 19:53:57.631704716 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0014-llvm50-handle-new-file_magic-s-location.patch 2018-05-30 12:29:50.732836872 +0200 @@ -65,5 +65,5 @@ Expected<std::unique_ptr<object::Binary> > arch = object::createBinary(Buffer, &Context); -- -2.15.1 +2.17.0 ++++++ 0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch -> 0015-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch 2018-01-31 19:53:57.651703785 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0015-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch 2018-05-30 12:29:50.744836433 +0200 @@ -13,10 +13,10 @@ 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp -index 5fe5bf9c1346..44293f885136 100644 +index ee6821b6dc18..9004b46e8f15 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp -@@ -2219,7 +2219,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { +@@ -2294,7 +2294,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { llvm::APFloat Arg(*fpWidthToSemantics(arg->getWidth()), arg->getAPValue()); uint64_t value = 0; bool isExact = true; @@ -30,7 +30,7 @@ llvm::APFloat::rmTowardZero, &isExact); bindLocal(ki, state, ConstantExpr::alloc(value, resultType)); break; -@@ -2236,7 +2241,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { +@@ -2311,7 +2316,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { uint64_t value = 0; bool isExact = true; @@ -45,5 +45,5 @@ bindLocal(ki, state, ConstantExpr::alloc(value, resultType)); break; -- -2.15.1 +2.17.0 ++++++ 0020-llvm50-AllocaInst-takes-address-space.patch -> 0016-llvm50-AllocaInst-takes-address-space.patch ++++++ --- /work/SRC/openSUSE:Factory/klee/0020-llvm50-AllocaInst-takes-address-space.patch 2018-01-31 19:53:57.663703227 +0100 +++ /work/SRC/openSUSE:Factory/.klee.new/0016-llvm50-AllocaInst-takes-address-space.patch 2018-05-30 12:29:50.760835846 +0200 @@ -12,7 +12,7 @@ 1 file changed, 8 insertions(+) diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp -index 02748fbc0ee5..30100b19af3b 100644 +index ff87d210b863..c85fee861f03 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -664,10 +664,18 @@ static int initEnv(Module *mainModule) { @@ -35,5 +35,5 @@ /* Insert void klee_init_env(int* argc, char*** argv) */ std::vector<const Type*> params; -- -2.15.1 +2.17.0 ++++++ 0017-llvm50-Intrinsic-objectsize-has-three-arguments.patch ++++++ From: Jiri Slaby <[email protected]> Date: Wed, 23 May 2018 15:01:34 +0200 Subject: llvm50: 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 <[email protected]> --- lib/Module/IntrinsicCleaner.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp index d4f93bdc591e..e8c63cd334d0 100644 --- a/lib/Module/IntrinsicCleaner.cpp +++ b/lib/Module/IntrinsicCleaner.cpp @@ -230,13 +230,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) + Value *nullArg = ii->getArgOperand(2); + assert(nullArg && "Failed to get second argument"); + ConstantInt *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.17.0 ++++++ 0018-llvm50-test-change-objectsize.patch ++++++ From: Jiri Slaby <[email protected]> Date: Wed, 23 May 2018 14:54:48 +0200 Subject: llvm50: test, change objectsize Patch-mainline: no @llvm.objectsize has now three aguments, so fix the tests accordingly. Signed-off-by: Jiri Slaby <[email protected]> --- 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.17.0 ++++++ 0019-llvm60-SetVersionPrinter-now-passes-down-a-stream.patch ++++++ From: Jiri Slaby <[email protected]> Date: Mon, 21 May 2018 15:12:44 +0200 Subject: llvm60: 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 <[email protected]> --- 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.17.0 ++++++ 0020-llvm60-handle-headers-renaming.patch ++++++ From: Jiri Slaby <[email protected]> Date: Mon, 21 May 2018 15:14:41 +0200 Subject: llvm60: handle headers renaming Patch-mainline: no Some headers were moved from llvm/Target/ to llvm/CodeGen/. Handle that. Signed-off-by: Jiri Slaby <[email protected]> --- 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 d9b3e40154ba..d478ff828796 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.17.0 ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.woXPVC/_old 2018-05-30 12:29:51.952792165 +0200 +++ /var/tmp/diff_new_pack.woXPVC/_new 2018-05-30 12:29:51.952792165 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/klee/klee.git</param> - <param name="changesrevision">37f554d5cf587ec9f6befa359a0e3aa60e9ce73f</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">843e9be8fc10c6ffb30218c5a826aab192a31955</param></service></servicedata> \ No newline at end of file ++++++ klee-1.4.0+20180108.tar.xz -> klee-1.4.0+20180524.tar.xz ++++++ ++++ 7256 lines of diff (skipped)
