tsan: do not call malloc/free in memory access handling routine.
This improves signal-/fork-safety of instrumented programs.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158988 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] more code for a specialized tsan allocator

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158991 91177308-0d34-0410-b5e6-96231b3b80d8
Allow divsi3 to take advantage of a hardware unsigned divide when it is available, by replacing an explicit call to udivsi3 with the divide operator.  Patch by Sébastien Bourdeauducq.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158996 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] add metadata to the new tsan allocator

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159002 91177308-0d34-0410-b5e6-96231b3b80d8
Disable the test subdirectory entirely until we get fresh CMake files
there. I didn't notice this because I had a stub that wasn't checked in
floating around in my client.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159025 91177308-0d34-0410-b5e6-96231b3b80d8
Reorder these things for clarity, and add -std=c99 to the compile flags.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159032 91177308-0d34-0410-b5e6-96231b3b80d8
Remove extraneous semicolons outside of functions. This fixes a large
number of -pedantic warnings.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159033 91177308-0d34-0410-b5e6-96231b3b80d8
Mechanical change to sink a #ifdef guard for a platform below the
include of int_lib.h.

The purpose of this change is to make the C code conform to the pedantic
rules of C99 -- an empty translation unit is not valid. It should have
absolutely no functional impact, and changes nothing about the built
libraries.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159034 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] fix -Wsign-compare

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159083 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] a better CHECK for OOM in the new allocator

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159122 91177308-0d34-0410-b5e6-96231b3b80d8
Lots of trivial changes to remove extraneous semicolons throughout ASan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159128 91177308-0d34-0410-b5e6-96231b3b80d8
Another big step toward a viable CMake build system for CompilerRT,
ASan, and friends.

This explicitly switches the CompilerRT CMake build to require CMake
version 2.8.8 or newer which provides first-class support for "object"
libraries which consist of a pile of '.o' files -- exactly what is
desired for composing runtime libraries. I've gone ahead and switched to
using this.

I've also added the interception library which I missed initially. And
I've added proper dependencies between the various libraries. With this,
I'm able to build archives for asan that appear to contain all of the
necessary .o files.

The final tweak here is to start setting up the compile flags and macro
defines expected by ASan and its helper libraries. These may not be
entirely correct currently, they're based loosely on my reading of the
old Makefiles. However, they can be tweaked more easily now that they're
wired up properly.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159129 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] get rid of '#include <malloc.h>' in the implementation of malloc interceptors

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159132 91177308-0d34-0410-b5e6-96231b3b80d8
Cleanup the handling of CFLAGS even more in the cmake build for ASan.
Add the initial support for building ASan tests.

The first change here is to try to get the CFLAGS to more closely match
those used by the old Makefile. There are probably still goofs here,
ASan folks, your review would be appreciated.

The second big change is to add support for building both
instrumentation based an non-instrumentation based unittests for ASan.
They are built a bit differently from how the old makefiles managed
things. Specifically, there are two binaries, one for the
non-instrumented case, and one for the instrumented case.

Also, the instrumented unit tests rely on the host compiler supporting
AddressSanitizer's intrumentation pass. This is kind-of gross, but
I don't know of a better way yet. I've mailed llvmdev to discuss this
issue.

One big caveat is that the detection logic currently doesn't work. I've
commented it out temporarily as I'd like to get feedback from the ASan
developers, etc.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159134 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] move tests from asan_interface_test.cc to asan_noinst_test.cc. Now all these tests do not require instrumentation and work directly with asan rt

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159135 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] fix the build

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159137 91177308-0d34-0410-b5e6-96231b3b80d8
[tsan] minor changes in tsan allocator

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159140 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: remove internal allocator, switch to sanitizer_common one.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159141 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: remove internal allocator, switch to sanitizer_common one.



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