Alexey Samsonov
555fc1db3c
ASan: wrap mapping scale and offset in a struct and make it a member of ASan passes. Add test for non-default mapping scale and offset. No functionality change
...
llvm-svn: 172610
2013-01-16 13:23:28 +00:00
Alexey Samsonov
b3bcf27f5a
[ASan] Fix lifetime intrinsics handling. Now for each intrinsic we check if 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
2012-12-27 08:50:58 +00:00
Alexey Samsonov
46f9cc5d51
Improve debug info generated with enabled AddressSanitizer.
...
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
2012-12-12 14:31:53 +00:00
Alexey Samsonov
84fd1cd1a4
ASan: add initial support for handling llvm.lifetime intrinsics in ASan - 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
2012-12-04 01:34:23 +00:00
Kostya Serebryany
5858a1aa4c
[asan] when checking the noreturn attribute on the call, also check it on the callee
...
llvm-svn: 168861
2012-11-29 08:57:20 +00:00
Kostya Serebryany
133cb3c737
[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), LLVM part. This requires a clang part which will follow.
...
llvm-svn: 168781
2012-11-28 10:31:36 +00:00
Kostya Serebryany
278702663c
[asan] don't instrument linker-initialized globals even with external linkage in -asan-initialization-order mode
...
llvm-svn: 168367
2012-11-20 13:11:32 +00:00
Kostya Serebryany
ae2ee8e3f1
[asan] make sure that linker-initialized globals (non-extern) are not instrumented even in -asan-initialization-order mode. This time with a test
...
llvm-svn: 168366
2012-11-20 13:00:01 +00:00
Kostya Serebryany
2bae7f204a
[asan] don't instrument globals that we've created ourselves (reduces the binary size a bit)
...
llvm-svn: 167230
2012-11-01 13:42:40 +00:00
Kostya Serebryany
83b25ee2df
[asan] make sure asan erases old unused allocas after it created a new one. This became important after the recent move from ModulePass to FunctionPass because no cleanup is happening after asan pass any more.
...
llvm-svn: 166267
2012-10-19 06:20:53 +00:00
Kostya Serebryany
21702ac519
[asan] fix a test
...
llvm-svn: 165938
2012-10-15 14:30:30 +00:00
Sylvestre Ledru
b77340e506
Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
...
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
1c5e7904de
Fix a typo 'iff' => 'if'
...
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Kostya Serebryany
7ada43d99a
[asan] add code to detect global initialization fiasco in C/C++. The sub-pass is off by default for now. Patch by Reid Watson. Note: this patch changes the interface between LLVM and compiler-rt parts of asan. The corresponding patch to compiler-rt will follow.
...
llvm-svn: 162268
2012-08-21 08:24:25 +00:00
Kostya Serebryany
5e3fbb5b34
[asan] insert crash basic blocks inline as opposed to inserting them at the end of the function. This doesn't seem to fix or break anything, but is considered to be more friendly to downstream passes (test change)
...
llvm-svn: 161871
2012-08-14 14:05:50 +00:00
Kostya Serebryany
a57ebfbe10
[asan] make sure that the crash callbacks do not get merged (Chandler's idea: insert an empty InlineAsm). Change the order in which the new BBs are inserted: the slow path BB is insert between old BBs, the crash BB is inserted at the end. Don't create an empty BB (introduced by recent commits). Update the test. The experimental code that does manual crash callback merge will most likely be deleted later.
...
llvm-svn: 160544
2012-07-20 09:54:50 +00:00
Kostya Serebryany
c80a9f4bea
[asan] refactor instrumentation to allow merging the crash callbacks (not fully implemented yet, no functionality change except the BB order)
...
llvm-svn: 160284
2012-07-16 16:15:40 +00:00
Chandler Carruth
800f86f31b
Revert r160254 temporarily.
...
It turns out that ASan relied on the at-the-end block insertion order to
(purely by happenstance) disable some LLVM optimizations, which in turn
start firing when the ordering is made more "normal". These
optimizations in turn merge many of the instrumentation reporting calls
which breaks the return address based error reporting in ASan.
We're looking at several different options for fixing this.
llvm-svn: 160256
2012-07-16 10:01:02 +00:00
Chandler Carruth
2f34858fa0
Teach AddressSanitizer to create basic blocks in a more natural order.
...
This is particularly useful to the backend code generators which try to
process things in the incoming function order.
Also, cleanup some uses of IRBuilder to be a bit simpler and more clear.
llvm-svn: 160254
2012-07-16 08:58:53 +00:00
Chandler Carruth
ff8e933c02
Add a basic test for AddressSanitizer. This is just a bare-bones
...
functionality test.
In general, unless the functionality is substantially separated, we
should lump more basic testing into this file. The test running
infrastructure likes having a few test files with more comprehensive
testing within them.
llvm-svn: 160253
2012-07-16 08:56:46 +00:00
Kostya Serebryany
9bdb57f07a
[asan] instrument cmpxchg and atomicrmw
...
llvm-svn: 157683
2012-05-30 09:04:06 +00:00
Kostya Serebryany
f5088bb8a5
[asan] move x86-specific test to a separate X86 directory with a custom lit.local.cfg file
...
llvm-svn: 152567
2012-03-12 18:49:11 +00:00
Eli Bendersky
4afdeeb682
Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
...
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.
llvm-svn: 150664
2012-02-16 06:28:33 +00:00
Kostya Serebryany
457b375949
[asan] fix asan-vs-gvn.ll test (it did not actually check much before this change)
...
llvm-svn: 150441
2012-02-14 00:02:35 +00:00
Kostya Serebryany
2de61e1628
[asan] unpoison the stack before every noreturn call. Fixes asan issue 37. llvm part
...
llvm-svn: 150102
2012-02-08 21:36:17 +00:00
Kostya Serebryany
f4be131943
The patch resolves the conflict between AddressSanitizer and load widening (GVN).
...
The problem initially reported by Mozilla folks (http://code.google.com/p/address-sanitizer/issues/detail?id=20 ),
but it also prevents us from enabling LLVM bootstrap with AddressSanitizer.
llvm-svn: 149925
2012-02-06 22:48:56 +00:00
Kostya Serebryany
ca8b911b2d
[asan] enable asan only for the functions that have Attribute::AddressSafety
...
llvm-svn: 148846
2012-01-24 19:34:43 +00:00
Kostya Serebryany
c69557e758
[asan] one more test for asan instrumentation: (*a)++ should be instrumented only once.
...
llvm-svn: 147509
2012-01-04 01:02:14 +00:00
Kostya Serebryany
c78b00cab4
[asan] add a test for instrumenting globals
...
llvm-svn: 146718
2011-12-16 01:28:19 +00:00
Kostya Serebryany
908509d41a
[asan] do not instrument threadlocal globals, this is buggy
...
llvm-svn: 145092
2011-11-23 02:10:54 +00:00
Kostya Serebryany
3a83736893
[asan] workaround for reg alloc bug 11395: don't instrument functions with large chunks of inline assembler
...
llvm-svn: 144962
2011-11-18 01:41:06 +00:00
Kostya Serebryany
3b8d362511
fall back to explicit list of allowed linkages when instrumenting globals in asan; add a test check that asan does not touch linkonce_odr
...
llvm-svn: 144933
2011-11-17 23:14:59 +00:00
Kostya Serebryany
4105068ea9
AddressSanitizer, first commit (compiler module only)
...
llvm-svn: 144758
2011-11-16 01:35:23 +00:00