From 0fdffd37095b5c5c405518d3fa651315a29a7dc5 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 7 Jul 2016 22:45:28 +0000 Subject: [tsan] Try harder to not instrument gcov counters GCOVProfiler::emitProfileArcs() can create many variables with names starting with "__llvm_gcov_ctr", so llvm appends a numeric suffix to most of them. Teach tsan about this. llvm-svn: 274801 --- llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 a23b1dd..dcb62d3 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -272,8 +272,8 @@ static bool shouldInstrumentReadWriteFromAddress(Value *Addr) { return false; } - // Check if the global is in the GCOV counters array. - if (GV->getName() == "__llvm_gcov_ctr") + // Check if the global is in a GCOV counter array. + if (GV->getName().startswith("__llvm_gcov_ctr")) return false; } -- cgit v1.1