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 | b1ad5720a27b36192bbed5bc510d193b5b5e7c58 (patch) | |
| tree | 23397e080101c0f0b767aa50a7aa17105e121191 /llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | |
| parent | ece9ede240f5ac341a4461abf933542ec9ea8030 (diff) | |
| download | bcm5719-llvm-b1ad5720a27b36192bbed5bc510d193b5b5e7c58.tar.gz bcm5719-llvm-b1ad5720a27b36192bbed5bc510d193b5b5e7c58.zip | |
tsan: implement no_sanitize_thread attribute
If a function has no_sanitize_thread attribute,
do not instrument memory accesses in it.
llvm-svn: 192871
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 2c8a7c4118e..89fb746a5c4 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/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]); } |

