summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make some DataLayout pointers const.Rafael Espindola2014-02-241-1/+1
| | | | | | No functionality change. Just reduces the noise of an upcoming patch. llvm-svn: 202087
* Rename many DataLayout variables from TD to DL.Rafael Espindola2014-02-211-16/+16
| | | | | | | | | I am really sorry for the noise, but the current state where some parts of the code use TD (from the old name: TargetData) and other parts use DL makes it hard to write a patch that changes where those variables come from and how they are passed along. llvm-svn: 201827
* Fix known typosAlp Toker2014-01-241-1/+1
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* Add an explicit insert point argument to SplitBlockAndInsertIfThen.Evgeniy Stepanov2013-12-191-7/+5
| | | | | | | | Currently SplitBlockAndInsertIfThen requires that branch condition is an Instruction itself, which is very inconvenient, because it is sometimes an Operator, or even a Constant. llvm-svn: 197677
* [msan] Propagate condition origin in select instruction.Evgeniy Stepanov2013-11-211-5/+12
| | | | llvm-svn: 195349
* [msan] Fast path optimization for wrap-indirect-calls feature of ↵Evgeniy Stepanov2013-11-141-12/+65
| | | | | | | | | | | | | | | | | | | MemorySanitizer. Indirect call wrapping helps MSanDR (dynamic instrumentation companion tool for MSan) to catch all cases where execution leaves a compiler-instrumented module by allowing the tool to rewrite targets of indirect calls. This change is an optimization that skips wrapping for calls when target is inside the current module. This relies on the linker providing symbols at the begin and end of the module code (or code + data, does not really matter). Gold linker provides such symbols by default. GNU (BFD) linker needs a link flag: -Wl,--defsym=__executable_start=0. More info: https://code.google.com/p/memory-sanitizer/wiki/MSanDR#Native_exec llvm-svn: 194697
* [msan] Propagate origin for insertvalue, extractvalue.Evgeniy Stepanov2013-11-111-2/+2
| | | | llvm-svn: 194374
* [msan] Use zero-extension in shadow cast by default.Evgeniy Stepanov2013-10-171-7/+8
| | | | | | Switch to sign-extension in r192575 caused 7% perf loss on 482.sphinx3. llvm-svn: 192882
* [msan] Instrument x86.*_cvt* intrinsics.Evgeniy Stepanov2013-10-141-28/+149
| | | | | | | | Currently MSan checks that arguments of *cvt* intrinsics are fully initialized. That's too much to ask: some of them only operate on lower half, or even quarter, of the input register. llvm-svn: 192599
* [msan] Fix handling of scalar select of vectors.Evgeniy Stepanov2013-10-141-4/+4
| | | | llvm-svn: 192575
* [msan] Fix -Wreturn-type warnings in non-self-hosted build.Evgeniy Stepanov2013-09-251-0/+2
| | | | llvm-svn: 191361
* [msan] Handling of atomic load/store, atomic rmw, cmpxchg.Evgeniy Stepanov2013-09-241-2/+96
| | | | llvm-svn: 191287
* [msan] Wrap indirect functions.Evgeniy Stepanov2013-09-191-7/+43
| | | | | | | | | Adds a flag to the MemorySanitizer pass that enables runtime rewriting of indirect calls. This is part of MSanDR implementation and is needed to return control to the DynamiRio-based helper tool on transition between instrumented and non-instrumented modules. Disabled by default. llvm-svn: 191006
* [msan] Check return value of main().Evgeniy Stepanov2013-09-161-4/+13
| | | | llvm-svn: 190782
* [msan] Add source file:line to stack origin reports.Evgeniy Stepanov2013-09-131-6/+8
| | | | | | Compiler part. llvm-svn: 190689
* [msan] Fix handling of select with struct arguments.Evgeniy Stepanov2013-09-031-3/+14
| | | | llvm-svn: 189796
* [msan] Fix select instrumentation.Evgeniy Stepanov2013-09-031-3/+6
| | | | | | | Select condition shadow was being ignored resulting in false negatives. This change OR-s sign-extended condition shadow into the result shadow. llvm-svn: 189785
* [msan] Fix handling of va_arg overflow area on x86_64.Evgeniy Stepanov2013-08-231-2/+1
| | | | | | | | The code was erroneously reading overflow area shadow from the TLS slot, bypassing the local copy. Reading shadow directly from TLS is wrong, because it can be overwritten by a nested vararg call, if that happens before va_start. llvm-svn: 189104
* Add SpecialCaseList::createOrDie() factory and use it in sanitizer passesAlexey Samsonov2013-08-121-1/+1
| | | | llvm-svn: 188169
* Rename BlackList class to SpecialCaseList and move it to Transforms/Utils.Peter Collingbourne2013-07-091-3/+3
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1089 llvm-svn: 185975
* [msan] Unpoison stack allocations and undef values in blacklisted functions.Evgeniy Stepanov2013-07-031-10/+14
| | | | | | | This changes behavior of -msan-poison-stack=0 flag from not poisoning stack allocations to actively unpoisoning them. llvm-svn: 185538
* [msan] Handle mixed track-origins and keep-going settings (llvm part).Evgeniy Stepanov2013-05-311-4/+6
| | | | | | | | | | | | | Before this change, each module defined a weak_odr global __msan_track_origins with a value of 1 if origin tracking is enabled, 0 if disabled. If there are modules with different values, any of them may win. If 0 wins, and there is at least one module with 1, the program will most likely crash. With this change, __msan_track_origins is only emitted if origin tracking is on. Then runtime library detects if there is at least one module with origin tracking, and enables runtime support for it. llvm-svn: 182997
* [msan] Fix argument shadow alignment.Evgeniy Stepanov2013-05-281-4/+11
| | | | llvm-svn: 182771
* [msan] A no-op implementation of VarArg handling.Evgeniy Stepanov2013-05-211-2/+23
| | | | | | | This stuff is used on platforms where MSan does not have a proper VarArg implementation (anything other than x86_64 at the moment). llvm-svn: 182375
* [msan] Switch TLS globals to initial-exec model.Evgeniy Stepanov2013-05-161-7/+7
| | | | | | They are always defined in the main executable. llvm-svn: 181994
* Fix a documentation warning: \bried -> \briefDmitri Gribenko2013-05-091-1/+1
| | | | llvm-svn: 181551
* [msan] Add an option to disable poisoning of shadow for undef values.Evgeniy Stepanov2013-03-211-2/+13
| | | | llvm-svn: 177630
* [msan] Implement sanitize_memory attribute.Evgeniy Stepanov2013-02-281-14/+38
| | | | | | | | | | Shadow checks are disabled and memory loads always produce fully initialized values in functions that don't have a sanitize_memory attribute. Value and argument shadow is propagated as usual. This change also updates blacklist behaviour to match the above. llvm-svn: 176247
* Remove unused leftover declarations.Evgeniy Stepanov2013-02-281-5/+0
| | | | llvm-svn: 176240
* Fixing warnings revealed by gcc release buildEdwin Vane2013-01-291-0/+1
| | | | | | | Fixed set-but-not-used warnings. Reviewer: gribozavr llvm-svn: 173810
* [msan] Mostly disable msan-handle-icmp-exact.Evgeniy Stepanov2013-01-281-6/+24
| | | | | | | | It is way too slow. Change the default option value to 0. Always do exact shadow propagation for unsigned ICmp with constants, it is cheap (under 1% cpu time) and required for correctness. llvm-svn: 173682
* Revert r173678.Evgeniy Stepanov2013-01-281-1/+1
| | | | | | Broken tests. llvm-svn: 173679
* [msan] Make msan-handle-icmp-exact=0 by default.Evgeniy Stepanov2013-01-281-1/+1
| | | | | | 50% slowdown on one of the specs. llvm-svn: 173678
* [msan] A comment on ICmp handling logic.Evgeniy Stepanov2013-01-251-0/+3
| | | | llvm-svn: 173453
* [msan] Implement exact shadow propagation for relational ICmp.Evgeniy Stepanov2013-01-251-0/+70
| | | | | | | | Only for integers, pointers, and vectors of those. No floats. Instrumentation seems very heavy, and may need to be replaced with some approximation in the future. llvm-svn: 173452
* Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKindBill Wendling2013-01-231-4/+7
| | | | | | when removing one attribute. This further encapsulates the use of the attributes. llvm-svn: 173214
* [msan] Export the value of msan-keep-going flag for the runtime.Evgeniy Stepanov2013-01-221-0/+3
| | | | llvm-svn: 173156
* [msan] Do not insert check on volatile store.Evgeniy Stepanov2013-01-221-4/+1
| | | | | | Volatile bitfields can cause valid stores of uninitialized bits. llvm-svn: 173153
* Sort all of the includes. Several files got checked in with mis-sortedChandler Carruth2013-01-191-1/+1
| | | | | | includes. llvm-svn: 172891
* Move Blacklist.h to include/ to enable use from clang.Will Dietz2013-01-181-1/+1
| | | | llvm-svn: 172806
* [msan] Fix handling of equality comparison of pointer vectors.Evgeniy Stepanov2013-01-151-6/+9
| | | | | | Also improve test coveration of the handling of relational comparisons. llvm-svn: 172539
* [msan] Change va_start/va_copy shadow memset alignment to 8.Peter Collingbourne2013-01-101-2/+2
| | | | | | | | | This fixes va_start/va_copy of a va_list field which happens to not be laid out at a 16-byte boundary. Differential Revision: http://llvm-reviews.chandlerc.com/D276 llvm-svn: 172128
* Actually update the CMake and Makefile builds correctly, and update theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | code that includes Intrinsics.gen directly. This never showed up in my testing because the old Intrinsics.gen was still kicking around in the make build system and was correct there. =[ Thankfully, some of the bots to clean rebuilds and that caught this. llvm-svn: 171373
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-9/+9
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Add proper support for -fsanitize-blacklist= flag for TSan and MSan. LLVM part.Alexey Samsonov2012-12-281-8/+14
| | | | llvm-svn: 171183
* [msan] Raise alignment of origin stores/loads when possible.Evgeniy Stepanov2012-12-261-5/+11
| | | | | | | Origin alignment is as high as the alignment of the corresponding application location, but never less than 4. llvm-svn: 171110
* [msan] Expand the file comment with track-origins info.Evgeniy Stepanov2012-12-261-5/+27
| | | | llvm-svn: 171109
* [msan] Fix handling of vectors of pointers.Evgeniy Stepanov2012-12-251-2/+7
| | | | | | | VectorType::getInteger() can not be used with them, because pointer size depends on the target. llvm-svn: 171070
* [msan] Fix handling of select with vector condition.Evgeniy Stepanov2012-12-251-2/+11
| | | | llvm-svn: 171069
* [msan] Remove unreachable blocks before instrumenting a function.Evgeniy Stepanov2012-12-211-0/+8
| | | | llvm-svn: 170883
OpenPOWER on IntegriCloud