[PATCH] D59067: [TSan][Linux] Fix libdispatch interception macros compilation errors

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 10:17:21 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL355619: [TSan][Linux] Fix libdispatch interception macros compilation errors (authored by yln, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59067?vs=189635&id=189748#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59067/new/

https://reviews.llvm.org/D59067

Files:
  compiler-rt/trunk/lib/tsan/rtl/tsan_libdispatch.cc


Index: compiler-rt/trunk/lib/tsan/rtl/tsan_libdispatch.cc
===================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_libdispatch.cc
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_libdispatch.cc
@@ -162,7 +162,7 @@
   Block_release(block);
 }
 
-#define DISPATCH_INTERCEPT_B(name, barrier)                                  \
+#define DISPATCH_INTERCEPT_ASYNC_B(name, barrier)                            \
   TSAN_INTERCEPTOR(void, name, dispatch_queue_t q, dispatch_block_t block) { \
     SCOPED_TSAN_INTERCEPTOR(name, q, block);                                 \
     SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START();                           \
@@ -190,7 +190,7 @@
     Acquire(thr, pc, (uptr)&new_context);                                    \
   }
 
-#define DISPATCH_INTERCEPT_F(name, barrier)                       \
+#define DISPATCH_INTERCEPT_ASYNC_F(name, barrier)                 \
   TSAN_INTERCEPTOR(void, name, dispatch_queue_t q, void *context, \
                    dispatch_function_t work) {                    \
     SCOPED_TSAN_INTERCEPTOR(name, q, context, work);              \
@@ -216,18 +216,21 @@
     Acquire(thr, pc, (uptr)&new_context);                                     \
   }
 
+#define DISPATCH_INTERCEPT(name, barrier)             \
+  DISPATCH_INTERCEPT_ASYNC_F(name##_async_f, barrier) \
+  DISPATCH_INTERCEPT_ASYNC_B(name##_async, barrier)   \
+  DISPATCH_INTERCEPT_SYNC_F(name##_sync_f, barrier)   \
+  DISPATCH_INTERCEPT_SYNC_B(name##_sync, barrier)
+
 // We wrap dispatch_async, dispatch_sync and friends where we allocate a new
 // context, which is used to synchronize (we release the context before
 // submitting, and the callback acquires it before executing the original
 // callback).
-DISPATCH_INTERCEPT_B(dispatch_async, false)
-DISPATCH_INTERCEPT_B(dispatch_barrier_async, true)
-DISPATCH_INTERCEPT_F(dispatch_async_f, false)
-DISPATCH_INTERCEPT_F(dispatch_barrier_async_f, true)
-DISPATCH_INTERCEPT_SYNC_B(dispatch_sync, false)
-DISPATCH_INTERCEPT_SYNC_B(dispatch_barrier_sync, true)
-DISPATCH_INTERCEPT_SYNC_F(dispatch_sync_f, false)
-DISPATCH_INTERCEPT_SYNC_F(dispatch_barrier_sync_f, true)
+DISPATCH_INTERCEPT(dispatch, false)
+DISPATCH_INTERCEPT(dispatch_barrier, true)
+
+DECLARE_REAL(void, dispatch_after_f, dispatch_time_t when,
+             dispatch_queue_t queue, void *context, dispatch_function_t work)
 
 TSAN_INTERCEPTOR(void, dispatch_after, dispatch_time_t when,
                  dispatch_queue_t queue, dispatch_block_t block) {
@@ -354,6 +357,9 @@
   });
 }
 
+DECLARE_REAL(void, dispatch_group_notify_f, dispatch_group_t group,
+             dispatch_queue_t q, void *context, dispatch_function_t work)
+
 TSAN_INTERCEPTOR(void, dispatch_group_notify, dispatch_group_t group,
                  dispatch_queue_t q, dispatch_block_t block) {
   SCOPED_TSAN_INTERCEPTOR(dispatch_group_notify, group, q, block);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59067.189748.patch
Type: text/x-patch
Size: 2917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190307/5a2a8a5a/attachment.bin>


More information about the llvm-commits mailing list