summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [asan] instrument invoke insns with noreturn attribute (as well as call insns)Kostya Serebryany2013-02-201-4/+5
| | | | llvm-svn: 175617
* [asan] instrument memory accesses with unusual sizesKostya Serebryany2013-02-191-29/+49
| | | | | | | | | | | | | | | | | This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or packed structures. Instrumentation is done with two 1-byte checks (first and last bytes) and if the error is found __asan_report_load_n(addr, real_size) or __asan_report_store_n(addr, real_size) is called. Also, call these two new functions in memset/memcpy instrumentation. asan-rt part will follow. llvm-svn: 175507
* [asan] revert r175266 as it breaks code with packed structures. supporting ↵Kostya Serebryany2013-02-181-1/+1
| | | | | | long double will require a more general solution llvm-svn: 175442
* [asan] support long double on 64-bit. See ↵Kostya Serebryany2013-02-151-1/+1
| | | | | | https://code.google.com/p/address-sanitizer/issues/detail?id=151 llvm-svn: 175266
* [asan] fix confusing indentationKostya Serebryany2013-02-131-1/+2
| | | | llvm-svn: 175033
* [ASan] Do not use kDefaultShort64bitShadowOffset on Mac, where the binaries ↵Alexander Potapenko2013-02-121-1/+2
| | | | | | may get mapped at 0x100000000+ and thus may interleave with the shadow. llvm-svn: 174964
* [asan] change the default mapping offset on x86_64 to 0x7fff8000. This gives ↵Kostya Serebryany2013-02-121-3/+5
| | | | | | roughly 5% speedup. Since this is an ABI change, bump the asan ABI version by renaming __asan_init to __asan_init_v1. llvm part, compiler-rt part will follow llvm-svn: 174957
* [asan] added a flag -mllvm asan-short-64bit-mapping-offset=1 (0 by default)Kostya Serebryany2013-02-111-2/+8
| | | | | | | | | | This flag makes asan use a small (<2G) offset for 64-bit asan shadow mapping. On x86_64 this saves us a register, thus achieving ~2/3 of the zero-base-offset's benefits in both performance and code size. Thanks Jakub Jelinek for the idea. llvm-svn: 174886
* [asan] fix 32-bit buildsKostya Serebryany2013-01-241-3/+3
| | | | llvm-svn: 173338
* [asan] adaptive redzones for globals (the larger the global the larger is ↵Kostya Serebryany2013-01-241-3/+13
| | | | | | the redzone) llvm-svn: 173335
* [asan] use ADD instead of OR when applying shadow offset of PowerPC. See ↵Kostya Serebryany2013-01-231-4/+15
| | | | | | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details llvm-svn: 173258
* 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
* ASan: add optional 'zero-based shadow' option to ASan passes. Always tell ↵Alexey Samsonov2013-01-171-35/+39
| | | | | | the values of shadow scale and offset to the runtime llvm-svn: 172709
* ASan: wrap mapping scale and offset in a struct and make it a member of ASan ↵Alexey Samsonov2013-01-161-51/+78
| | | | | | passes. Add test for non-default mapping scale and offset. No functionality change llvm-svn: 172610
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-8/+8
| | | | | | | | | | | | | | | | | | | | | 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
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-301-1/+2
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171253
* [ASan] Fix lifetime intrinsics handling. Now for each intrinsic we check if ↵Alexey Samsonov2012-12-271-69/+91
| | | | | | it describes one of 'interesting' allocas. Assume that allocas can go through casts and phi-nodes before apperaring as llvm.lifetime arguments llvm-svn: 171153
* ASan: initialize callbacks from ASan module pass in a separate function for ↵Alexey Samsonov2012-12-251-21/+28
| | | | | | consistency llvm-svn: 171061
* ASan: move stack poisoning logic into FunctionStackPoisoner structAlexey Samsonov2012-12-251-190/+220
| | | | llvm-svn: 171060
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-1/+1
| | | | | | single attribute in the future. llvm-svn: 170502
* Improve debug info generated with enabled AddressSanitizer.Alexey Samsonov2012-12-121-0/+4
| | | | | | | | | | | | When ASan replaces <alloca instruction> with <offset into a common large alloca>, it should also patch llvm.dbg.declare calls and replace debug info descriptors to mark that we've replaced alloca with a value that stores an address of the user variable, not the user variable itself. See PR11818 for more context. llvm-svn: 169984
* [asan] add experimental -asan-realign-stack option (true by default, which ↵Kostya Serebryany2012-12-041-2/+7
| | | | | | does not change the current behavior) llvm-svn: 169216
* ASan: add initial support for handling llvm.lifetime intrinsics in ASan - ↵Alexey Samsonov2012-12-041-3/+108
| | | | | | emit calls into runtime library that poison memory for local variables when their lifetime is over and unpoison memory when their lifetime begins. llvm-svn: 169200
* ASan: add blacklist file to ASan pass options. Clang patch for this will follow.Alexey Samsonov2012-12-031-13/+22
| | | | llvm-svn: 169143
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-11/+10
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* [asan] simplify the code around doesNotReturn call. It now magically works. Kostya Serebryany2012-11-301-8/+1
| | | | llvm-svn: 168995
* [ASan] Simplify check added in r168861. Bail out from module pass early if ↵Alexey Samsonov2012-11-291-2/+2
| | | | | | the module is blacklisted. llvm-svn: 168913
* Add options to AddressSanitizer passes to make them configurable by frontend.Alexey Samsonov2012-11-291-11/+28
| | | | llvm-svn: 168910
* [asan/tsan] initialize the asan/tsan callbacks in runOnFunction as opposed ↵Kostya Serebryany2012-11-291-26/+31
| | | | | | to doInitialization. This is required to allow the upcoming changes in PassManager behavior llvm-svn: 168864
* [asan] when checking the noreturn attribute on the call, also check it on ↵Kostya Serebryany2012-11-291-1/+9
| | | | | | the callee llvm-svn: 168861
* [asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), ↵Kostya Serebryany2012-11-281-25/+25
| | | | | | LLVM part. This requires a clang part which will follow. llvm-svn: 168781
* llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp: Prune ↵NAKAMURA Takumi2012-11-221-1/+0
| | | | | | AddressSanitizerCreateGlobalRedzonesPass::ID. [-Wunused-variable] llvm-svn: 168499
* [asan] rip off the creation of global redzones from the main ↵Kostya Serebryany2012-11-221-52/+75
| | | | | | AddressSanitizer class into a separate class. The intent is to make it a separate ModulePass in the following commmits llvm-svn: 168484
* [asan] use names of globals instead of an external set to distinguish the ↵Kostya Serebryany2012-11-201-4/+8
| | | | | | globals generated by asan llvm-svn: 168368
* [asan] don't instrument linker-initialized globals even with external ↵Kostya Serebryany2012-11-201-5/+3
| | | | | | linkage in -asan-initialization-order mode llvm-svn: 168367
* [asan] make sure that linker-initialized globals (non-extern) are not ↵Kostya Serebryany2012-11-201-31/+31
| | | | | | instrumented even in -asan-initialization-order mode. This time with a test llvm-svn: 168366
* [asan] fix bug 14277 (asan needs to fail with fata error if an __asan ↵Kostya Serebryany2012-11-071-2/+3
| | | | | | interface function is being redefined. Before this fix asan asserts) llvm-svn: 167529
* Fix whitespacesAlexey Samsonov2012-11-021-2/+2
| | | | llvm-svn: 167295
* [asan] don't instrument globals that we've created ourselves (reduces the ↵Kostya Serebryany2012-11-011-3/+6
| | | | | | binary size a bit) llvm-svn: 167230
* Revert the majority of the next patch in the address space series:Chandler Carruth2012-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. llvm-svn: 167222
* Move SplitBlockAndInsertIfThen to BasicBlockUtils.Evgeniy Stepanov2012-10-191-35/+4
| | | | llvm-svn: 166278
* [asan] make sure asan erases old unused allocas after it created a new one. ↵Kostya Serebryany2012-10-191-0/+4
| | | | | | This became important after the recent move from ModulePass to FunctionPass because no cleanup is happening after asan pass any more. llvm-svn: 166267
* [asan] better debug diagnostics in asan compiler moduleKostya Serebryany2012-10-171-4/+4
| | | | llvm-svn: 166102
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-151-1/+1
| | | | | | different pointer sizes on a per address space basis. llvm-svn: 165941
* [asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. ↵Kostya Serebryany2012-10-151-63/+52
| | | | | | This will simplify chaining other FunctionPasses with asan. Also some minor cleanup llvm-svn: 165936
* Revert 165732 for further review.Micah Villmow2012-10-111-1/+1
| | | | llvm-svn: 165747
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-111-1/+1
| | | | | | per address space pointer sizes to be optimized correctly. llvm-svn: 165726
* Create enums for the different attributes.Bill Wendling2012-10-091-3/+5
| | | | | | | We use the enums to query whether an Attributes object has that attribute. The opaque layer is responsible for knowing where that specific attribute is stored. llvm-svn: 165488
OpenPOWER on IntegriCloud