about summary refs log tree commit diff homepage
path: root/lib/Module
AgeCommit message (Collapse)Author
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-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-04kleeModule: always link irreader (required since llvm 3.3)Julian Büning
2018-10-04remove obsolete dependency of kleeModule on kleeCoreJulian Büning
2018-09-18llvm4: errorOr and similarJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-09-18llvm4: handle different header namesJiri Slaby
LLVM 4 renamed and splitted some headers. Take this into account in includes. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-09-14llvm: make KLEE compile against LLVM 3.9Jiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-09-10Unify the error message if that function has not been found.Martin Nowack
2018-09-10Fix generation of global constructors and destructorsMartin Nowack
Validate if the user-selected entry function exists. Do not assume it is `main`.
2018-08-03Replace remaining *Inst::Create() calls with llvm::BuilderMartin Nowack
Replace the remaining occurrences of `Inst::Create()` with `llvm::Builder` to manage metadata automatically and to fold instructions. C++11 it and clang-format
2018-07-28remove last comma from -debug-print-escaping-functionsJulian Büning
2018-07-28add declarations to escapingFunctionsJulian Büning
2018-07-23ModuleUtil: improve and test valueIsOnlyCalledJulian Büning
* handle BlockAddress (which is not a valid function pointer) * there is no instruction with opcode 0 * add test for functionality
2018-07-23fix: LLVM 3.5, begin_user() instead of begin_use()Julian Büning
With version 3.5, LLVM introduced a subtle semantic change in the API of `Value`. With that change, `use_begin()` is renamed to `user_begin()`. Additionally, a new method `use_begin()` with a different meaning was introduced. Now, `use_begin()` actually iterates over `Use`s, whereas before, dereferencing it would give a `User *`. For further details, please refer to https://reviews.llvm.org/rL203364. Due to the reintroduction of `use_begin()`, existing code may still compile, although the semantics have changed. In the code changed with this patch, all `dyn_cast`s for `Use` fail and the else branch is always taken.
2018-07-12llvm38: no more implicit iteratorsRichard Trembecký
LLVM commit eac309550f25 removed implicit iterator conversions. So we have to get the iterators explicitly now. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-12llvm38: archive child iterator changesJiri Slaby
After LLVM commit 25569fdcdab0, archive iterator returns object::Archive::Child instead of child_iterator, adapt to that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-12llvm38: adapt to new Linker::linkModulesJiri Slaby
LLVM commit d912be98f8eb changed the prototype of linkModules to accept std::unique_ptr. Adapt to that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-12llvm38: handle optimization passes changesJiri Slaby
createFunctionAttrsPass was split to createPostOrderFunctionAttrsPass and createReversePostOrderFunctionAttrsPass in LLVM commit e96fb9ab15d4. createGlobalsModRefPass was changed to createGlobalsAAWrapperPass in LLVM commit 9146833fa313. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-04Reorder linking and optimizationsMartin Nowack
Link intrinsic library before executing optimizations. This makes sure that any optimization run by KLEE on the module is executed for the intrinsic library as well. Support .ll files as input for KLEE as well.
2018-05-24llvm: make KLEE compile against LLVM 3.7Richard Trembecký
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-05-24llvm37: handle GetElementPtrInst::Create's new parameterJiri Slaby
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>
2018-05-22clang-format on lib/Module/{IntrinsicCleaner.cpp,Passes.h}Julian Büning
2018-05-22some housekeeping in Passes.h and IntrinsicCleaner.cppJulian Büning
This commit addresses the following: * remove unused variables block_split (::runOnBasicBlock) and LI (::IntrinsicCleanerPass) in IntrinsicCleanerPass * add `dirty = true` to `Intrinsic::vacopy` case * use `eraseFromParent()` methods instead of `removeFromParent()` and `delete` * add `override` keyword to `runOn{Module,Function}` methods
2018-05-22Simplified printFileLine by using std::to_string, and removed unneeded ↵Cristian Cadar
version that takes an argument a stream
2018-05-09Remove the option for truncating lines in assembly.llMartin Nowack
The behaviour couldn't be triggered for a kcachegrind from 2012.
2018-05-09Remove workaround for bug in older LLVM version (< 3)Martin Nowack
2018-05-09Fix include filesMartin Nowack
2018-02-01llvm50: use auto variable instead of SwitchInst::CaseItJiri Slaby
llvm50 changed the semantics of SwitchInst::CaseIt and started using "auto" variable type. So use it here too for all versions greater than 3.4 -- 3.4 does not support this semantics yet. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-10-04Remove Autoconf/Makefile build system and adjust the TravisCIDan Liew
configuration, TravisCI scripts and Dockerfile build appropriately. There are a bunch of clean ups this enables but this commit doesn't attempt them. We can do that in future commits.
2017-10-03Silenced some warnings about unused variables when assertions are disabled.Cristian Cadar
2017-08-27Remove unnecessary null pointer checksOscar Deits
Fixes klee/klee#717 delete on null pointer is always safe.
2017-08-09Fixed a compiler warning (unused variable)Cristian Cadar
2017-08-04Removed merging searchersLukas Wölfer
2017-07-29Added another variant of printFileLine in KInstruction that returns the ↵Cristian Cadar
location as a string. Also added const qualifier to the printFileLine functions
2017-07-25Merge pull request #725 from ccadar/foldCristian Cadar
Refactored some code related to constant evaluation
2017-07-25Added the const qualifier to the keys in the constantMapCristian Cadar
2017-07-24llvm: get rid of static_casts from iterators (take 2)Jörg Thalheim
follow up of c9c90a0ecdce10172fd5318aea60a9ff4057679f
2017-07-23Remove support for LLVM < 3.4Martin Nowack
Request LLVM 3.4 as minimal requirement for KLEE
2017-07-20Merge pull request #657 from delcypher/vectorized_instructionsCristian Cadar
Implement basic support for vectorized instructions.
2017-07-20Replace assertions of types on LLVM instructions in the Executor with aDan Liew
pass that checks these assertions. This improves several things. * This pass provides more friendly messages than assertions in that it just emits a warning and carries on checking the rest of the instructions. * The takes the checks outside of the Executor's hot path and so avoids checking the same instruction multiple times. Now each instruction is only checked once just before execution starts. The disadvantage of this approach is the check for invariants we expect to hold have been pulled far away from where we expect them to hold. After discussion with @ccadar and @MartinNowack it was decided we will take this hit to readability for better performance and simpler code in the Executor.
2017-07-19Implement basic support for vectorized instructions.Dan Liew
We use LLVM's Scalarizer pass to remove most vectorized code so that the Executor only needs to support the InsertElement and ExtractElement instructions. This pass was not available in LLVM 3.4 so to support that LLVM version the pass has been back ported. To check that the Executor is not receiving vector operand types that it can't handle assertions have been added. There are a few limitations to this implementation. * The InsertElement and ExtractElement index cannot be symbolic. * There is no support for LLVM < 3.4.
2017-07-18Merge pull request #672 from jirislaby/llvm40_static_castsAndrea Mattavelli
llvm: get rid of static_casts from iterators
2017-06-16move module loading into external functionJörg Thalheim
- having an explicit function which is defined for multiple llvm versions separately increases readability. - also: error handling was simplified - Personal motivation: being able to use this functionality in unit tests fixes #561 related to #656
2017-06-16llvm37: introduce type for PassManagerJiri Slaby
In LLVM 3.7, PassManager was moved to the legacy:: namespace. Introduce a type for it and use it in the code. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>