Reverting r220517; it seems this broke check-asan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220869 91177308-0d34-0410-b5e6-96231b3b80d8
Update __dfsw_s{,n}printf custom functions for new calling convention.

Differential Revision: http://reviews.llvm.org/D6029

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220907 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] run-time part of the caller-callee coverage instrumentation

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220975 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] increase the initial buffer size in caller-callee dumper

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220991 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Fix signed-compare warning in the unit test

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221190 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan} Build Go version with -std=c++11

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221192 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Use StackTrace from sanitizer_common where applicable

Summary:
This change removes `__tsan::StackTrace` class. There are
now three alternatives:
  # Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer
  of PCs. It is used in functions that need stack traces in read-only
  mode, and helps to prevent unnecessary allocations/copies (e.g.
  for StackTraces fetched from StackDepot).
  # `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in
  a constant array. It is used in TraceHeader (non-Go version)
  # `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically
  allocated via TSan internal allocator.

Test Plan: compiler-rt test suite

Reviewers: dvyukov, kcc

Reviewed By: kcc

Subscribers: llvm-commits, kcc

Differential Revision: http://reviews.llvm.org/D6004

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221194 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Remove bogus unused global variables

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221195 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Don't strip binary/library name until the moment we print it.

This commit changes the place where TSan runtime turns full path
to binary or shared library into its basename
(/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible
(when we obtained the full path from the symbolizer), we now do it as
late as possible (right before printing the error report).

This seems like a right thing to do - stripping to basename is a detail
of report formatting implementation, and should belong there. Also, we
might need the full path at some point - for example, to match the
suppressions.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221225 91177308-0d34-0410-b5e6-96231b3b80d8
Use @rpath as LC_ID_DYLIB for ASan dylib on OS X

Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library.

Reviewed at http://reviews.llvm.org/D6018




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221278 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Keep original function and filename in ReportStack.

TSan used to do the following transformations with data obtained
from the symbolizer:
1) Strip "__interceptor_" prefix from function name.
2) Use "strip_path_prefix" runtime flag to strip filepath.

Now these transformations are performed right before the stack trace
is printed, and ReportStack structure contains original information.

This seems like a right thing to do - stripping is a detail of report
formatting implementation, and should belong there. We should, for
example, use original path to source file when we apply suppressions.

This change also make "strip_path_prefix" flag behavior in TSan
consistent with all the other sanitizers - now it should actually
match *the prefix* of path, not some substring. E.g. earlier TSan
would turn "/usr/lib/libfoo.so" into "libfoo.so" even if strip_path_prefix
was "/lib/".

Finally, strings obtained from symbolizer come from internal allocator,
and "stripping" them early by incrementing a "char*" ensures they can
never be properly deallocated, which is a bug.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221283 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221287 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] [mips] changed ShadowOffset32 for systems having 16kb PageSize; patch by Kumar Sukhani

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221288 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Make ReportStack contain __sanitizer::AddressInfo object.

AddressInfo contains the results of symbolization. Store this object
directly in the symbolized stack, instead of copying data around and
making unnecessary memory allocations.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221294 91177308-0d34-0410-b5e6-96231b3b80d8
Correct the usage of DataInfo structure in TSan

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221297 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Refactor/simplify ReportLocation structure.

  # Make DataInfo (describing a global) a member of ReportLocation
    to avoid unnecessary copies and allocations.
  # Introduce a constructor and a factory method, so that
    all structure users don't have to go to internal allocator directly.
  # Remove unused fields (file/line).

No functionality change.


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