Kostya Serebryany
f224182c86
[tsan] typo and style (thanks to Nick Lewycky)
...
llvm-svn: 155986
2012-05-02 13:12:19 +00:00
Kostya Serebryany
c855c442c8
[asan] small optimization: do not emit "x+0" instructions
...
llvm-svn: 155701
2012-04-27 10:04:53 +00:00
Kostya Serebryany
0cd695bd39
[tsan] Atomic support for ThreadSanitizer, patch by Dmitry Vyukov
...
llvm-svn: 155698
2012-04-27 07:31:53 +00:00
Alexander Potapenko
1f7d60fd8a
Fix issue 67 by checking that the interface functions weren't redefined in the compiled source file.
...
llvm-svn: 155346
2012-04-23 10:47:31 +00:00
Kostya Serebryany
67e32a152a
[tsan] use llvm/ADT/Statistic.h for tsan stats
...
llvm-svn: 155341
2012-04-23 08:44:59 +00:00
Kostya Serebryany
3047a70ed9
[tsan] two more compile-time optimizations:
...
- don't isntrument reads from constant globals.
Saves ~1.5% of instrumented instructions on CPU2006
(counting static instructions, not their execution).
- don't insrument reads from vtable (which is a global constant too).
Saves ~5%.
I did not measure the run-time impact of this,
but it is certainly non-negative.
llvm-svn: 154444
2012-04-10 22:29:17 +00:00
Kostya Serebryany
01d463472d
[tsan] compile-time instrumentation: do not instrument a read if
...
a write to the same temp follows in the same BB.
Also add stats printing.
On Spec CPU2006 this optimization saves roughly 4% of instrumented reads
(which is 3% of all instrumented accesses):
Writes : 161216
Reads : 446458
Reads-before-write: 18295
llvm-svn: 154418
2012-04-10 18:18:56 +00:00
Kostya Serebryany
605c594f4f
[tsan] treat vtable pointer updates in a special way (requires tbaa); fix a bug (forgot to return true after instrumenting); make sure the tsan tests are run
...
llvm-svn: 153448
2012-03-26 17:35:03 +00:00
Kostya Serebryany
19681e071c
[asan] fix one more bug related to long double
...
llvm-svn: 153189
2012-03-21 15:28:50 +00:00
Kostya Serebryany
f8cb0a65c1
[asan] don't emit __asan_mapping_offset/__asan_mapping_scale by default -- they are currently used only for experiments
...
llvm-svn: 153040
2012-03-19 16:40:35 +00:00
Kostya Serebryany
ee6f6a527d
[tsan] use FunctionBlackList
...
llvm-svn: 152755
2012-03-14 23:33:24 +00:00
Kostya Serebryany
70c5b4a077
[asan] rename class BlackList to FunctionBlackList and move it into a separate file -- we will need the same functionality in ThreadSanitizer
...
llvm-svn: 152753
2012-03-14 23:22:10 +00:00
Evgeniy Stepanov
19a3f5fed4
ASan: use getTypeAllocSize instead of getTypeStoreSize.
...
This change replaces getTypeStoreSize with getTypeAllocSize in AddressSanitizer
instrumentation for stack allocations.
One case where old behaviour produced undesired results is an optimization in
InstCombine pass (PromoteCastOfAllocation), which can replace alloca(T) with
alloca(S), where S has the same AllocSize, but a smaller StoreSize. Another
case is memcpy(long double => long double), where ASan will poison bytes 10-15
of a stack-allocated long double (StoreSize 10, AllocSize 16,
sizeof(long double) = 16).
See http://llvm.org/bugs/show_bug.cgi?id=12047 for more context.
llvm-svn: 151887
2012-03-02 10:41:08 +00:00
Kostya Serebryany
7b2649a9ca
[tsan] fix compiler warnings
...
llvm-svn: 150449
2012-02-14 00:52:07 +00:00
Kostya Serebryany
5cd1e1380f
ThreadSanitizer, a race detector. First LLVM commit.
...
Clang patch (flags) will follow shortly.
The run-time library will also follow, but not immediately.
llvm-svn: 150423
2012-02-13 22:50:51 +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
Craig Topper
639b152ca5
Convert assert(0) to llvm_unreachable
...
llvm-svn: 149967
2012-02-07 05:05:23 +00:00
Chris Lattner
9782adedd7
reapply the patches reverted in r149470 that reenable ConstantDataArray,
...
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul. Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.
llvm-svn: 149800
2012-02-05 02:29:43 +00:00
Argyrios Kyrtzidis
492f34016f
Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.
...
These are:
r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365
llvm-svn: 149470
2012-02-01 04:51:17 +00:00
Chris Lattner
a9b3505e9a
eliminate the "string" form of ConstantArray::get, using
...
ConstantDataArray::getString instead.
llvm-svn: 149365
2012-01-31 06:18:43 +00:00
Kostya Serebryany
e5567f0fe4
[asan] fix the ObjC support (asan Issue #33 )
...
llvm-svn: 149300
2012-01-30 23:50:10 +00:00
Alexander Potapenko
bc80f88393
Fix compilation of ASan tests on OS X Lion (see http://code.google.com/p/address-sanitizer/issues/detail?id=32 )
...
The redzones emitted by AddressSanitizer for CFString instances confuse the linker and are of little use, so we shouldn't add them.
llvm-svn: 149243
2012-01-30 10:40:22 +00:00
Kostya Serebryany
0a789a0d8c
[asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA Takumi
...
llvm-svn: 149172
2012-01-28 04:27:16 +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
Alexander Potapenko
bd636a5fe8
Implemented AddressSanitizer::getPassName()
...
llvm-svn: 148697
2012-01-23 11:22:43 +00:00
Kostya Serebryany
03444e57e8
[asan] extend the workaround for http://llvm.org/bugs/show_bug.cgi?id=11395 : don't instrument the function at all on x86_32 if it has a large asm blob
...
llvm-svn: 147953
2012-01-11 18:15:23 +00:00
Kostya Serebryany
a7d1b796b9
[asan] cleanup: remove the SIGILL-related code (compiler part)
...
llvm-svn: 147667
2012-01-06 18:09:21 +00:00
Kostya Serebryany
847d2d2c25
[asan] add the name of the module to the description of a global variable. This improves the readability of global-buffer-overflow reports.
...
llvm-svn: 146698
2011-12-15 22:55:55 +00:00
Kostya Serebryany
65849ee22a
[asan] fix a bug (issue 19) where dlclose and the following mmap caused a false positive. compiler part.
...
llvm-svn: 146688
2011-12-15 21:59:03 +00:00
Kostya Serebryany
7d3cbe255e
[asan] remove .preinit_array from the compiler module (it breaks .so builds). This should be done in the run-time.
...
llvm-svn: 146527
2011-12-14 00:01:51 +00:00
Kostya Serebryany
8c4be7b06e
[asan] report an error if blacklist file contains a malformed regex. fixes asan issue 17
...
llvm-svn: 146503
2011-12-13 19:34:53 +00:00
Daniel Dunbar
30d6a45140
LLVMBuild: Remove trailing newline, which irked me.
...
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Kostya Serebryany
da73ce34a1
[asan] use .preinit_array only on linux
...
llvm-svn: 146379
2011-12-12 18:01:46 +00:00
Kostya Serebryany
e3281eff91
[asan] call __asan_init from .preinit_array. This simplifies __asan_init vs malloc chicken-and-egg situation on Android and probably on other flavours of Linux. Patch by eugenis@google.com.
...
llvm-svn: 146284
2011-12-09 22:09:32 +00:00
Nick Lewycky
d59dcc5ddb
Expose a switch for the new gcov format.
...
llvm-svn: 145880
2011-12-06 00:29:13 +00:00
Kostya Serebryany
78bd9e81b4
[asan] two minor fixes: use UnreachableInst after the neverreturn function call; use report_fatal_error when blacklist file can not be found
...
llvm-svn: 145611
2011-12-01 18:54:53 +00:00
Daniel Dunbar
4e00f5f8fd
build/CMake: Finish removal of add_llvm_library_dependencies.
...
llvm-svn: 145420
2011-11-29 19:25:30 +00:00
Nick Lewycky
f8210714b8
Place the "cfg checksum" around a test. This was recently added in April 2011 to
...
gcc, though I thought it was older (my gcc 4.4 has it as a local patch. Whoops!)
This fixes PR10589.
Also add some debugging statements.
Remove GcnoFiles, the mapping from CompilationUnit to raw_ostream. Now that we
start by iterating over each CU and descending into them, there's no need to
maintain a mapping.
llvm-svn: 145208
2011-11-27 23:22:20 +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
6081213d59
quick fix: remove GlobalVariable::GlobalVariable mistakenly commited at r144933. For some reason this compiles on linux
...
llvm-svn: 144936
2011-11-17 23:37:53 +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
Benjamin Kramer
a2f57dee6d
Remove all remaining uses of Value::getNameStr().
...
llvm-svn: 144648
2011-11-15 16:27:03 +00:00
Daniel Dunbar
3760ebeebb
build: Add initial cut at LLVMBuild.txt files.
...
llvm-svn: 143634
2011-11-03 18:53:17 +00:00
Devang Patel
76e4b3cba8
If simple ownership works then friendship is not required.
...
llvm-svn: 140169
2011-09-20 18:48:56 +00:00
Devang Patel
5332ddba93
Update GCOVLines to provide interfaces to write line table and calculate complete length.
...
llvm-svn: 140167
2011-09-20 18:35:00 +00:00
Devang Patel
06d7cd5b4e
Update comment.
...
llvm-svn: 140156
2011-09-20 18:05:45 +00:00
Devang Patel
65d142a389
Use StringRef instead of std::string.
...
llvm-svn: 140154
2011-09-20 17:55:19 +00:00
Devang Patel
cb1e53c7ba
Eliminate unnecessary copy of FileName from GCOVLines.
...
GCOVLines is always accessed through a StringMap where the key is FileName.
llvm-svn: 140151
2011-09-20 17:43:14 +00:00