[PATCH] D31630: [tsan] Detect races on modifying accesses in Swift code

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 15:48:25 PDT 2017


kubamracek added inline comments.


================
Comment at: lib/tsan/rtl/tsan_report.cc:215
     } else {
       Printf("  Location is %s object of size %zu at %p allocated by %s:\n",
              object_type, loc->heap_chunk_size, loc->heap_chunk_start,
----------------
dvyukov wrote:
> It's better to drop "object" here to make it more general. A user can always add "object" to tag name if necessary.
https://reviews.llvm.org/D32383


================
Comment at: lib/tsan/rtl/tsan_rtl.h:651
+  kExternalTagSwiftModifyingAccess = 1,
+  kExternalTagFirstUserAvailable = 128,
+  kExternalTagMax = 1024,
----------------
dvyukov wrote:
> Why is it 128? It seems it should be 2.
https://reviews.llvm.org/D32382


================
Comment at: test/tsan/Darwin/external-swift.cc:10
+extern "C" {
+void *__tsan_external_register_tag(const char *object_type);
+void *__tsan_external_assign_tag(void *addr, void *tag);
----------------
dvyukov wrote:
> Declare them in test.h. They will be used by other tests in future.
https://reviews.llvm.org/D32384


https://reviews.llvm.org/D31630





More information about the llvm-commits mailing list