From 894abb46f891cba2e0ef581650f27f512a7824b4 Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Wed, 21 Aug 2019 23:42:06 +0000 Subject: [PATCH] [TSan] #include header instead of forward declaring interceptees llvm-svn: 369601 --- .../lib/tsan/rtl/tsan_interceptors_mac.cpp | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp index db7392796202..8b748c110f2d 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #if defined(__has_include) && __has_include() @@ -246,21 +247,7 @@ TSAN_INTERCEPTOR(void, os_lock_unlock, void *lock) { REAL(os_lock_unlock)(lock); } -extern "C" { - #define _LOCK_AVAILABILITY \ - __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) \ - __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) - - _LOCK_AVAILABILITY void os_unfair_lock_lock(void *lock); - // NOTE: `options` actually has type `os_unfair_lock_options_t` but this - // should be ABI compatible. - _LOCK_AVAILABILITY void os_unfair_lock_lock_with_options(void *lock, - u32 options); - _LOCK_AVAILABILITY bool os_unfair_lock_trylock(void *lock); - _LOCK_AVAILABILITY void os_unfair_lock_unlock(void *lock); -} - -TSAN_INTERCEPTOR(void, os_unfair_lock_lock, void *lock) { +TSAN_INTERCEPTOR(void, os_unfair_lock_lock, os_unfair_lock_t lock) { if (!cur_thread()->is_inited || cur_thread()->is_dead) { return REAL(os_unfair_lock_lock)(lock); } @@ -269,7 +256,7 @@ TSAN_INTERCEPTOR(void, os_unfair_lock_lock, void *lock) { Acquire(thr, pc, (uptr)lock); } -TSAN_INTERCEPTOR(void, os_unfair_lock_lock_with_options, void *lock, +TSAN_INTERCEPTOR(void, os_unfair_lock_lock_with_options, os_unfair_lock_t lock, u32 options) { if (!cur_thread()->is_inited || cur_thread()->is_dead) { return REAL(os_unfair_lock_lock_with_options)(lock, options); @@ -279,7 +266,7 @@ TSAN_INTERCEPTOR(void, os_unfair_lock_lock_with_options, void *lock, Acquire(thr, pc, (uptr)lock); } -TSAN_INTERCEPTOR(bool, os_unfair_lock_trylock, void *lock) { +TSAN_INTERCEPTOR(bool, os_unfair_lock_trylock, os_unfair_lock_t lock) { if (!cur_thread()->is_inited || cur_thread()->is_dead) { return REAL(os_unfair_lock_trylock)(lock); } @@ -290,7 +277,7 @@ TSAN_INTERCEPTOR(bool, os_unfair_lock_trylock, void *lock) { return result; } -TSAN_INTERCEPTOR(void, os_unfair_lock_unlock, void *lock) { +TSAN_INTERCEPTOR(void, os_unfair_lock_unlock, os_unfair_lock_t lock) { if (!cur_thread()->is_inited || cur_thread()->is_dead) { return REAL(os_unfair_lock_unlock)(lock); }