diff options
author | Kuba Mracek <mracek@apple.com> | 2017-05-03 16:51:01 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-05-03 16:51:01 +0000 |
commit | 4e8f70074eb0b1b8612f770d269791afaac38f74 (patch) | |
tree | 145f99b95c637f2424f8340a2352ce2d92a251e1 /include | |
parent | f5be24d91f5c9975ce71c5343b7c5731ce560d42 (diff) |
[tsan] Detect races on modifying accesses in Swift code
This patch allows the Swift compiler to emit calls to `__tsan_external_write` before starting any modifying access, which will cause TSan to detect races on arrays, dictionaries and other classes defined in non-instrumented modules. Races on collections from the Swift standard library and user-defined structs and a frequent cause of subtle bugs and it's important that TSan detects those on top of existing LLVM IR instrumentation, which already detects races in direct memory accesses.
Differential Revision: https://reviews.llvm.org/D31630
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/sanitizer/tsan_interface.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sanitizer/tsan_interface.h b/include/sanitizer/tsan_interface.h index a0c702638..5ea09ab5c 100644 --- a/include/sanitizer/tsan_interface.h +++ b/include/sanitizer/tsan_interface.h @@ -126,6 +126,7 @@ void __tsan_mutex_post_divert(void *addr, unsigned flags); // which is later used in read/write annotations to denote the object type // - __tsan_external_assign_tag can optionally mark a heap object with a tag void *__tsan_external_register_tag(const char *object_type); +void __tsan_external_register_header(void *tag, const char *header); void __tsan_external_assign_tag(void *addr, void *tag); void __tsan_external_read(void *addr, void *caller_pc, void *tag); void __tsan_external_write(void *addr, void *caller_pc, void *tag); |