[compiler-rt] r286658 - [tsan] Expose __tsan_ignore_thread_begin and __tsan_ignore_thread_end in TSan interface
Anna Zaks via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 11 14:43:12 PST 2016
Author: zaks
Date: Fri Nov 11 16:43:12 2016
New Revision: 286658
URL: http://llvm.org/viewvc/llvm-project?rev=286658&view=rev
Log:
[tsan] Expose __tsan_ignore_thread_begin and __tsan_ignore_thread_end in TSan interface
This patch is needed to implement the function attribute that disable TSan checking at run time.
Differential Revision: https://reviews.llvm.org/D25859
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h
compiler-rt/trunk/lib/tsan/rtl/tsan_interface_inl.h
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h?rev=286658&r1=286657&r2=286658&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h Fri Nov 11 16:43:12 2016
@@ -73,6 +73,9 @@ void __tsan_vptr_update(void **vptr_p, v
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_entry(void *call_pc);
SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_exit();
+SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_begin();
+SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_end();
+
SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_read_range(void *addr, unsigned long size); // NOLINT
SANITIZER_INTERFACE_ATTRIBUTE
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface_inl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_inl.h?rev=286658&r1=286657&r2=286658&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface_inl.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface_inl.h Fri Nov 11 16:43:12 2016
@@ -108,6 +108,14 @@ void __tsan_func_exit() {
FuncExit(cur_thread());
}
+void __tsan_ignore_thread_begin() {
+ ThreadIgnoreBegin(cur_thread(), CALLERPC);
+}
+
+void __tsan_ignore_thread_end() {
+ ThreadIgnoreEnd(cur_thread(), CALLERPC);
+}
+
void __tsan_read_range(void *addr, uptr size) {
MemoryAccessRange(cur_thread(), CALLERPC, (uptr)addr, size, false);
}
More information about the llvm-commits
mailing list