Fix ReadFileToBuffer to return 0 on failure (-1 is too large if returned as size_t).


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156538 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] First commit of ThreadSanitizer (TSan) run-time library.

Algorithm description: http://code.google.com/p/thread-sanitizer/wiki/ThreadSanitizerAlgorithm

Status:
The tool is known to work on large real-life applications, but still has quite a few rough edges.
Nothing is guaranteed yet.

The tool works on x86_64 Linux.
Support for 64-bit MacOS 10.7+ is planned for late 2012.
Support for 32-bit OSes is doable, but problematic and not yet planed.

Further commits coming:
  - tests
  - makefiles
  - documentation
  - clang driver patch

The code was previously developed at http://code.google.com/p/data-race-test/source/browse/trunk/v2/
by Dmitry Vyukov and Kostya Serebryany with contributions from
Timur Iskhodzhanov, Alexander Potapenko, Alexey Samsonov and Evgeniy Stepanov.




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156542 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] add the old Makefile (which is the only way to build the tsan-rtl for now)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156544 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] ThreadSanitizer tests and micro benchmarks. No makefiles yet.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156545 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] old-dstyle Makefile for tests; two helper scripts that analyze the assembly code of the hot functions

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156547 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] a bit more lint

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156614 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] run more kinds of builds as presubmit test (and fix gcc debug build)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156616 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] run output tests in parallel

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156617 91177308-0d34-0410-b5e6-96231b3b80d8
Fix GetFrameNameByAddr hitting stale stack guards.

In the current implementation AsanThread::GetFrameNameByAddr scans the
stack for a magic guard value to locate base address of the stack
frame. This is not reliable, especially on ARM, where the code that
stores this magic value has to construct it in a register from two
small intermediates; this register can then end up stored in a random
stack location in the prologue of another function.

With this change, GetFrameNameByAddr scans the shadow memory for the
signature of a left stack redzone instead. It is now possible to
remove the magic from the instrumentation pass for additional
performance gain. We keep it there for now just to make sure the new
algorithm does not fail in some corner case.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156710 91177308-0d34-0410-b5e6-96231b3b80d8
Increase error_message_buffer_size to 64K (16K is insufficient for large programs)



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@156711 91177308-0d34-0410-b5e6-96231b3b80d8