From b1ad5720a27b36192bbed5bc510d193b5b5e7c58 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 17 Oct 2013 07:20:06 +0000 Subject: tsan: implement no_sanitize_thread attribute If a function has no_sanitize_thread attribute, do not instrument memory accesses in it. llvm-svn: 192871 --- llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp') diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 2c8a7c4..89fb746 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]); } -- cgit v1.1