about summary refs log tree commit diff homepage
AgeCommit message (Collapse)Author
2018-10-26llvm7: adapt to new openFileForWriteJiri Slaby
In llvm commit 03bcb2143b5c, OpenFlags were split and openFileForWrite accepts one more parameter. Fortunately, openFileForWrite now defaults to F_None, so we remove the parameter completely from llvm 3.7 and later. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm7: WriteBitcodeToFile takes Module &Jiri Slaby
Since llvm commit 06d6207c1c63, WriteBitcodeToFile accepts Module &, not Module *. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26Added gen-bout tool to generate ktest file (file.bout) using specified ↵Andrew Santosa
concrete arguments and files. * Sample use cases: * Using an interesting input as a seed, such as a crashing input. * Analyzing the path condition of a crashing input. * Also added the test: test/Runtime/POSIX/GenBout.c
2018-10-26travis: enable LLVM 6 testingJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm6: handle headers renamingJiri Slaby
Some headers were moved from llvm/Target/ to llvm/CodeGen/. Handle that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm6: SetVersionPrinter now passes down a streamJiri Slaby
I.e. klee::printVersion should now have a parameter -- the output stream. Change both the prototype and the implementation to handle this properly. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26travis: enable LLVM 5 testingJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: APInt->getSignBit -> getSignMaskJiri Slaby
This was renamed in LLVM commit 54f0462d2b7f, so handle the rename. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: CallSite.paramHasAttr is indexed from 0Jiri Slaby
Since LLVM 5 commit 1f8f0490690b, CallSite.paramHasAttr is indexed from 0, so make sure we use correct indexing in klee. And use CallSite.hasRetAttr for return attributes. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: test, add -disable-O0-optnone to -O0Jiri Slaby
Otherwise optimizations done in klee won't have any effect. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: test, change objectsizeJiri Slaby
@llvm.objectsize has now three aguments, so fix the tests accordingly. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: Intrinsic::objectsize has three argumentsJiri Slaby
Modify the IntrinsicCleaner accordingly. We do not do anything with the third argument as we do not handle the first argument in any way. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: use MutableArrayRef for APFloat::convertToIntegerJiri Slaby
In llvm 5, since commit 957caa243d9270df37a566aedae3f1244e7b62ef, the first parameter to APFloat::convertToInteger is MutableArrayRef. So handle that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: handle new file_magic's locationJiri Slaby
llvm 5, moved file_magic to BinaryFormat in commit 19ca2b0f9daed883c21730285d7f04424e5f5f88, so adapt to that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: SwitchInst case functions now return pointersJiri Slaby
Starting llvm 5, SwitchInst->findCaseValue() now has to be dereferenced using ->. So do so, otherwise we see: ../lib/Core/Executor.cpp:1598:38: error: no member named 'getCaseSuccessor' in 'llvm::SwitchInst::CaseIteratorImpl<llvm::SwitchInst::CaseHandle>'; did you mean to use '->' instead of '.'? BasicBlock *caseSuccessor = i.getCaseSuccessor(); ^ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: handle getOrInsertFunction terminatorJiri Slaby
llvm 5 does not terminate getOrInsertFunction parameters with NULL, take care of that. Since commit 9d54400bba7eb04bca80fce97fa170452d19eaf1. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: integerPartWidth is from llvm::APFloatBaseJiri Slaby
Otherwise we see: ../lib/Expr/Expr.cpp:331:14: error: no member named 'integerPartWidth' in namespace 'llvm'; did you mean 'llvm::APFloatBase::integerPartWidth'? Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: avoid ++ on function->arg_begin()Jiri Slaby
Starting with llvm 5, arguments of a function are not an iterator, but an array. So they cannot be incremented in-place. Add a local auto variable and increment that. Otherwise we see: ../tools/klee/main.cpp:661:23: error: expression is not assignable Value *oldArgv = &*(++mainFn->arg_begin()); ^ ~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-24Add testcase for shift checkMartin Nowack
Validate non-optimised and optimised variant of added checks.
2018-10-24ShiftChecker: Instrument shift instructions only onceMartin Nowack
As the shift checker could be executed multiple times, we need to avoid that shift instructions are instrumented multiple times as well. Mark the instrumented instruction using metadata and avoid it in successive runs.
2018-10-24ShiftChecker: Avoid unneeded checksMartin Nowack
Do not instrument shift operations with constant shift operations that are smaller than the type size.
2018-10-24ShiftCheck: Use llvm::Builder instead of Inst::Create*Martin Nowack
Use llvm::Builder instead of Inst::Create* to create instruction. This handles metadata automatically and does instruction folding if possible. Updated to C++11 and clang-formatted.
2018-10-24Add test case for div checkerMartin Nowack
Check that only important div instructions are annotated. Check the optimized case as well: the call to the validating function might not be part of the code anymore but already inlined - make sure the instruction still has the metadata attached.
2018-10-24DivCheck do not instrument multiple timesMartin Nowack
DivChecker can be executed multiple times due to the new linking process. Avoid instrumenting div instructions multiple times by annotating checked instructions with marker. Only unmarked div instructions will be instrumented.
2018-10-24DivCheck Skip unneeded checksMartin Nowack
Do not instrument divisions which do have a constant non-zero value.
2018-10-24Use llvm::Builder for DivCheck instrumentationMartin Nowack
Use llvm::Builder instead of raw `*Inst::create()` functions. Builder automatically manages metadata (e.g. debug, TBAA, ..) such that we don't have to take care of this automatically. Updated code to C++11 and clang-formated it.
2018-10-24Introduce KLEEIRMetaData to manipulate LLVM-IR metadataMartin Nowack
Simplify the handling of metadata attached to LLVM IR that is specific to KLEE.
2018-10-24Added lowering passRafael Zaehl
2018-10-23refactor klee_open_output_file to return std::unique_ptrJulian Büning
and introduce klee_open_compressed_output_file with similar behavior along some other minor improvements
2018-10-23use klee_open_output_file for uncompressed logsJulian Büning
2018-10-23Updated an include to reflect a recent filename changeCristian Cadar
2018-10-23Move unrelated function from ReadExpr classMartin Nowack
2018-10-23Avoid unsafe static downcastsMartin Nowack
2018-10-23Modernize codeMartin Nowack
* use `using` instead of typdef * use `collection.empty()` instead of size * use `auto` if clear * use `emplace_back` where useful * use `nullptr` instead of NULL * use `override` if applicable * use `explicit` for constructor to avoid implicit conversion
2018-10-23Move optimization specific headers away from the project include directoryMartin Nowack
Don't pollute the project include directory with optimization specific headers.
2018-10-23Clean-up headersMartin Nowack
Remove unneeded headers from include files
2018-10-23Use std::unordered collections as we use C++11Martin Nowack
2018-10-23Remove unneeded externsMartin Nowack
2018-10-23Remove condition check before function invocationMartin Nowack
Conditions are checked inside of `optimizeExpr()` anyway. This simplifies the code a lot.
2018-10-23Move ConstantExpr check inside optimizeExpr functionMartin Nowack
2018-10-23optimizeExpr: return the result as return value instead as function argumentMartin Nowack
simplifies code a lot.
2018-10-23Make valueOnly parameter of optimizeExpr explicitMartin Nowack
avoid ambiguity of valueOnly parameter
2018-10-23Fixed compilation of array optimization patch with LLVM >= 4.0Cristian Cadar
2018-10-23Added missing headers and clang-format the filesCristian Cadar
2018-10-23Added support for KLEE value-based array optimizationAndrea Mattavelli
2018-10-23Added support for KLEE index-based array optimizationAndrea Mattavelli
2018-10-17tests: disable CompressedExprLogging on zlib-less systemsFrank Busse
2018-10-16Small changes to commentsCristian Cadar
2018-10-16Added missing header to SolverCmdLine.h and clang-format itCristian Cadar
2018-10-16Renamed klee/CommandLine.h to klee/SolverCmdLine.h, since this file is meant ↵Cristian Cadar
to have only solver options.