[PATCH] D13391: [compiler-rt] Fix Clang-tidy modernize-use-nullptr warnings in lib/tsan; other minor fixes.

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 06:40:38 PST 2015


dvyukov added a subscriber: dvyukov.
dvyukov requested changes to this revision.
dvyukov added a reviewer: dvyukov.
dvyukov added a comment.
This revision now requires changes to proceed.

nullptr's are ok
I don't understand the motivation behind the rest of changes.


================
Comment at: lib/tsan/dd/dd_interceptors.cc:32
@@ -31,3 +31,3 @@
     return false;
-  if (thr != 0)
     return true;
----------------
This was done on a purpose. Now it looks like thr is a bool. It is not.

================
Comment at: lib/tsan/dd/dd_interceptors.cc:333
@@ -332,2 +332,1 @@
 
-}  // namespace __dsan
----------------
The style guide required exactly 2 spaces here. Have it changed?

================
Comment at: lib/tsan/rtl/tsan_interceptors.cc:210
@@ -210,3 +209,3 @@
   ThreadSignalContext *ctx = (ThreadSignalContext*)thr->signal_ctx;
-  if (ctx == 0 && !thr->is_dead) {
+  if ((!ctx) && !thr->is_dead) {
     ctx = (ThreadSignalContext*)MmapOrDie(sizeof(*ctx), "ThreadSignalContext");
----------------
Why additional brackets??


Repository:
  rL LLVM

http://reviews.llvm.org/D13391





More information about the llvm-commits mailing list