OSDN Git Service

Add support for tsan annotations (thread sanitizer, a valgrind-based tool).
authorNick Lewycky <nicholas@mxc.ca>
Mon, 14 Nov 2011 20:50:16 +0000 (20:50 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Mon, 14 Nov 2011 20:50:16 +0000 (20:50 +0000)
commit4d0a9ff36574da0c042e9bd3ae816301b392ac41
treec5e1c2d7d88829785d73dbe6173da013f4554af3
parent76c8f08567c1e06e8555a910e919d4896f18f5e2
Add support for tsan annotations (thread sanitizer, a valgrind-based tool).
These annotations are disabled entirely when either ENABLE_THREADS is off, or
building a release build. When enabled, they add calls to functions with no
statements to ManagedStatic's getters.

Use these annotations to inform tsan that the race used inside ManagedStatic
initialization is actually benign. Thanks to Kostya Serebryany for helping
write this patch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144567 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/ManagedStatic.h
include/llvm/Support/Valgrind.h
lib/Support/ManagedStatic.cpp
lib/Support/Valgrind.cpp
unittests/Support/ManagedStatic.cpp [new file with mode: 0644]