[PATCH] tsan: find races between atomic and plain memory accesses

Kostya Serebryany kcc at google.com
Fri Feb 1 01:35:51 PST 2013


  Excellent!


================
Comment at: tsan/rtl/tsan_interface_atomic.cc:234
@@ +233,3 @@
+    return kSizeLog4;
+  else
+    return kSizeLog8;
----------------
maybe add an assert that size is <= 8 
or at least add a comment

================
Comment at: tsan/rtl/tsan_rtl.h:297
@@ +296,3 @@
+
+  bool IsRWNotWeaker(int kIsWrite, bool kIsAtomic) const {
+    bool v = (((x_ >> kWriteShift) & 3) ^ 1)
----------------
s/int/bool/

================
Comment at: tsan/rtl/tsan_rtl.h:305
@@ +304,3 @@
+
+  bool IsRWWeakerOrEqual(int kIsWrite, bool kIsAtomic) const {
+    bool v = (((x_ >> kWriteShift) & 3) ^ 1)
----------------
s/int/bool/


http://llvm-reviews.chandlerc.com/D357



More information about the llvm-commits mailing list