[compiler-rt] r224755 - tsan: fix style

Dmitry Vyukov dvyukov at google.com
Mon Dec 22 23:21:24 PST 2014


Author: dvyukov
Date: Tue Dec 23 01:21:23 2014
New Revision: 224755

URL: http://llvm.org/viewvc/llvm-project?rev=224755&view=rev
Log:
tsan: fix style

Usually we roll the variable declaration into the condition in cases like this.


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc?rev=224755&r1=224754&r2=224755&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_report.cc Tue Dec 23 01:21:23 2014
@@ -251,9 +251,8 @@ ThreadContext *IsThreadStackOrTls(uptr a
 
 void ScopedReport::AddThread(int unique_tid, bool suppressable) {
 #ifndef SANITIZER_GO
-  const ThreadContext *tctx = FindThreadByUidLocked(unique_tid);
-  if (tctx)
-    AddThread(FindThreadByUidLocked(unique_tid), suppressable);
+  if (const ThreadContext *tctx = FindThreadByUidLocked(unique_tid))
+    AddThread(tctx, suppressable);
 #endif
 }
 





More information about the llvm-commits mailing list