[PATCH] D50920: [tsan] Avoid calling Block_copy in the "sync" GCD interceptors

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 12:27:15 PDT 2018


delcypher added a comment.

Seems fine but with some minor nits.



================
Comment at: test/tsan/Darwin/gcd-sync-block-copy.mm:6
+
+// RUN: %clang_tsan %s -o %t -framework Foundation
+// RUN: %run %t 2>&1 | FileCheck %s
----------------
For the purposes of examining test artifacts after tests have run, it's probably better to give your executables different names (e.g. `%t_no_tsan` and `%t_with_tsan`).


================
Comment at: test/tsan/Darwin/gcd-sync-block-copy.mm:16
+- (instancetype)retain {
+  abort();
+}
----------------
I presume you're relying on the copy of the block to increment the reference count to your object? Perhaps add a comment to this effect?

I presume it's guaranteed that the Objective-C runtime won't try to do any tagged pointer optimizations here which would break the assumption that a copy increases the reference count?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D50920





More information about the llvm-commits mailing list