[compiler-rt] [TSAN] Add __tsan_check_no_mutexes_held helper (PR #69372)

Kenny Yu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 15:17:03 PDT 2023


================
@@ -216,11 +218,16 @@ static void PrintMutexShortWithAddress(const ReportMutex *rm,
          reinterpret_cast<void *>(rm->addr), d.Default(), after);
 }
 
-static void PrintMutex(const ReportMutex *rm) {
+static void PrintMutex(const ReportMutex *rm, ReportType typ) {
   Decorator d;
   Printf("%s", d.Mutex());
-  Printf("  Mutex M%u (%p) created at:\n", rm->id,
-         reinterpret_cast<void *>(rm->addr));
+  if (typ != ReportTypeMutexCannotBeLocked) {
+    Printf("  Mutex M%u (%p) created at:\n", rm->id,
+           reinterpret_cast<void *>(rm->addr));
+  } else {
+    Printf("  Mutex M%u (%p) acquired at:\n", rm->id,
+           reinterpret_cast<void *>(rm->addr));
+  }
----------------
kennyyu wrote:

Will revert

https://github.com/llvm/llvm-project/pull/69372


More information about the llvm-commits mailing list