about summary refs log tree commit diff homepage
path: root/lib/Module/KModule.cpp
AgeCommit message (Collapse)Author
2019-10-31support compilation against LLVM 9.0Julian Büning
2019-05-30implement FunctionAliasPassJulian Büning
2019-03-21drop support for LLVM <= 3.7Julian Büning
2019-03-21remove obsolete LegacyLLVMPassManagerTyJulian Büning
2019-03-19Use debugging information from newer LLVM versionsMartin Nowack
2019-03-19Refactor InstructionInfoTableMartin Nowack
Better debug information
2019-03-18Disable optimisation for functions that contain KLEE callsMartin Nowack
Compilers are allowed to hoist function calls and do GVE. This is currently done even without `--optimization` enabled. This is unfortunate in the context of KLEE function calls that might depend on specific code position without direct control flow dependencies. In such cases, function calls can be hoisted. To circumvent this, disallow to optimise functions that contain such calls by default. This might reduce optimisation for some functions containing such function calls but still allows it for all others. This patch adds an additional pass, that detects all functions starting with a prefix `klee_` and disable optimisations for functions containing such calls. This is enabled by default but can be disabled by `--klee-call-optimisation=false`.
2019-03-17run VerifierPass after optimization and instrumentationJulian Büning
2019-03-15Created a new module-related option category and moved the options in ↵Cristian Cadar
KModule.cpp in there
2019-03-11Add support for LLVM 8.0Martin Nowack
2018-10-26llvm7: handle new header filesJiri Slaby
createLowerSwitchPass moved in llvm commit 49ca55e3813c to Utils.h. createInstructionCombiningPass moved in llvm commitb5b7fce64c1d to InstCombine.h. So add the includes where needed. 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-24Added lowering passRafael Zaehl
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-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-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-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
2017-08-09Fixed a compiler warning (unused variable)Cristian Cadar
2017-08-04Removed merging searchersLukas Wölfer
2017-07-25Added the const qualifier to the keys in the constantMapCristian Cadar
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-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>
2017-06-15llvm: get rid of static_casts from iteratorsJiri Slaby
In commit b7a6aec4eeb4 (convert iterators using static_cast), I switched all implicit casts to static_cast. It turned out that llvm 4.0 banned casting via static_cast. See e.g. 1e2bc42eb988 in the llvm repo what they do. So similarly to the above commit, change all the casts of iterators to "&*" which is what they do in LLVM. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-06-12llvm: don't use clEnumValEnd for LLVM 4.0Jiri Slaby
It became unnecessary when defining options and mainly undefined. So introduce KLEE_LLVM_CL_VAL_END as suggested by @delcypher. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-05-24llvm: make KLEE compile against LLVM 3.5 and 3.6Richard Trembecký
Based on work by @ccadeptic23 and @delcypher. Formatting fixed by @snf. Fix compiler warning by @martijnthe. Further fixes by @mchalupa. Refactored, so that changes can be reviewed -- no massive changes in whitespace and in the surrounding code. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-02-28convert iterators using static_castJiri Slaby
Newer versions of LLVM do not allow to implicitly cast iterators to pointers where they point. So convert all such uses to explicit static_cast, the same as LLVM code does. Otherwise we see errors like: lib/Core/Executor.cpp:548:15: error: no viable conversion from 'Module::iterator' (aka 'ilist_iterator<llvm::Function>') to 'llvm::Function *' Function *f = i; ^ ~ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2017-02-25llvm: stop using global contextJiri Slaby
It was marked as deprecated long time ago and finally removed in LLVM 3.9. Remove all uses of getGlobalContext and create our own context. Propagate it all over the code then. [v2] use ctx, not C as name Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2016-09-16Avoid internalization of non-standard entry point (i.e. not the main ↵Andrea Mattavelli
function) (#455)
2015-12-17Refactoring: Moving klee_warning/_error functions to ErrorHandling in ↵Martin Nowack
Support directory
2014-09-15Removed inlineChecks() function which was just dead code.Dan Liew
2014-09-14[LLVM3.5] Update for more random headers moving around.Daniel Dunbar
2014-09-14[LLVM3.5] Update for CallSite.h move into IR/.Daniel Dunbar
2014-09-14[LLVM3.5] Don't try to use DEBUG macro without DEBUG_TYPE.Daniel Dunbar
2014-09-13Add KLEE specific DEBUG macros.Daniel Dunbar
- This allows us to build in +Asserts mode even when LLVM isn't (by disabling the checks in that mode). - Eventually it would be nice to just move off of LLVM's DEBUG infrastructure entirely and just have our own copy, but this works for now. - Fixes #150.
2014-05-29Refactoring from std::ostream to llvm::raw_ostreamMartin Nowack
According to LLVM: lightweight and simpler implementation of streams.
2014-04-14Tidy up code by using LLVM's V2 path API only and removing usesDan Liew
of old V1 path API. LLVM2.9 supports LLVM's V2 path API. Because that is the minimum version we support we should just use this API everywhere so we reduce the number of #if LLVM_VERSION_CODE macros and duplicated code.
2014-04-14Use SmallString and llvm::sys::path/fs API of LLVM 3.4 becauseMartin Nowack
Old Path API was removed
2014-01-17Make KLEE fail in case main function is missingMartin Nowack
Existence of main() function is checked with assertion. This check fails if KLEE is compiled in Release mode.
2013-12-19Optimize inlineChecks functionMartin Nowack
* Just iterate over the instructions which use the function to be inlined * Handle each callsite (e.g. CallInst and InvokeInst)
2013-12-19Allow to specify KLEE-internal functionsMartin Nowack
KLEE provides runtime library functions to do detection of bugs (e.g. overflow). This runtime functions are not the location of the bugs but it is the next non-runtime library function from the stack. Use the caller inside that function to indicate where the bug is.