diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-10-17 07:20:06 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-10-17 07:20:06 +0000 |
commit | 4ef1999d61f955917f86320f3b1c6e3352fd0b49 (patch) | |
tree | 3f9f4d1f98159f33e968fe992437f14b589f2aab /lib/Transforms/Instrumentation/ThreadSanitizer.cpp | |
parent | 49af380e3b007c678a7e4354efff601fd30a6681 (diff) | |
download | external_llvm-4ef1999d61f955917f86320f3b1c6e3352fd0b49.zip external_llvm-4ef1999d61f955917f86320f3b1c6e3352fd0b49.tar.gz external_llvm-4ef1999d61f955917f86320f3b1c6e3352fd0b49.tar.bz2 |
tsan: implement no_sanitize_thread attribute
If a function has no_sanitize_thread attribute,
do not instrument memory accesses in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/ThreadSanitizer.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 2c8a7c4..89fb746 100644 --- a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -358,7 +358,7 @@ bool ThreadSanitizer::runOnFunction(Function &F) { // (e.g. variables that do not escape, etc). // Instrument memory accesses. - if (ClInstrumentMemoryAccesses) + if (ClInstrumentMemoryAccesses && F.hasFnAttribute(Attribute::SanitizeThread)) for (size_t i = 0, n = AllLoadsAndStores.size(); i < n; ++i) { Res |= instrumentLoadOrStore(AllLoadsAndStores[i]); } |