[compiler-rt] r189474 - [sanitizer] fix code style

Alexey Samsonov samsonov at google.com
Wed Aug 28 04:26:09 PDT 2013


Author: samsonov
Date: Wed Aug 28 06:26:09 2013
New Revision: 189474

URL: http://llvm.org/viewvc/llvm-project?rev=189474&view=rev
Log:
[sanitizer] fix code style

Modified:
    compiler-rt/trunk/lib/msan/msan.cc
    compiler-rt/trunk/lib/msan/msan.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc

Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=189474&r1=189473&r2=189474&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Wed Aug 28 06:26:09 2013
@@ -248,7 +248,8 @@ void ScopedThreadLocalStateBackup::Resto
 
   if (__msan_get_track_origins()) {
     internal_memset(&__msan_retval_origin_tls, 0, sizeof(__msan_retval_tls));
-    internal_memset(__msan_param_origin_tls, 0, sizeof(__msan_param_origin_tls));
+    internal_memset(__msan_param_origin_tls, 0,
+                    sizeof(__msan_param_origin_tls));
   }
 }
 

Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=189474&r1=189473&r2=189474&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Wed Aug 28 06:26:09 2013
@@ -87,12 +87,12 @@ void UnpoisonThreadLocalState();
         common_flags()->fast_unwind_on_malloc)
 
 class ScopedThreadLocalStateBackup {
-public:
+ public:
   ScopedThreadLocalStateBackup() { Backup(); }
   ~ScopedThreadLocalStateBackup() { Restore(); }
   void Backup();
   void Restore();
-private:
+ private:
   u64 va_arg_overflow_size_tls;
 };
 }  // namespace __msan

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h?rev=189474&r1=189473&r2=189474&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h Wed Aug 28 06:26:09 2013
@@ -45,10 +45,10 @@ class StackDepotReverseMap {
 
  private:
   struct IdDescPair {
-   u32 id;
-   StackDesc *desc;
+    u32 id;
+    StackDesc *desc;
 
-   static bool IdComparator(const IdDescPair &a, const IdDescPair &b);
+    static bool IdComparator(const IdDescPair &a, const IdDescPair &b);
   };
 
   InternalMmapVector<IdDescPair> map_;

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc?rev=189474&r1=189473&r2=189474&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc Wed Aug 28 06:26:09 2013
@@ -309,12 +309,12 @@ static struct sigaction old_sigactions[A
 class StopTheWorldScope {
  public:
   StopTheWorldScope() {
-    // Glibc's sigaction() has a side-effect where it copies garbage stack values
-    // into oldact, which can cause false negatives in LSan. As a quick workaround
-    // we zero some stack space here.
+    // Glibc's sigaction() has a side-effect where it copies garbage stack
+    // values into oldact, which can cause false negatives in LSan. As a quick
+    // workaround we zero some stack space here.
     WipeStack();
-    // Block all signals that can be blocked safely, and install default handlers
-    // for the remaining signals.
+    // Block all signals that can be blocked safely, and install
+    // default handlers for the remaining signals.
     // We cannot allow user-defined handlers to run while the ThreadSuspender
     // thread is active, because they could conceivably call some libc functions
     // which modify errno (which is shared between the two threads).
@@ -355,6 +355,7 @@ class StopTheWorldScope {
     }
     sigprocmask(SIG_SETMASK, &old_sigset, &old_sigset);
   }
+
  private:
   int process_was_dumpable_;
 };

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc?rev=189474&r1=189473&r2=189474&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_common_test.cc Wed Aug 28 06:26:09 2013
@@ -163,14 +163,14 @@ bool UptrLess(uptr a, uptr b) {
 }
 
 TEST(SanitizerCommon, InternalBinarySearch) {
-  const uptr sz = 5;
-  uptr arr[sz];
-  for (uptr i = 0; i < sz; i++) arr[i] = i * i;
+  static const uptr kSize = 5;
+  uptr arr[kSize];
+  for (uptr i = 0; i < kSize; i++) arr[i] = i * i;
 
-  for (uptr i = 0; i < sz; i++)
-    ASSERT_EQ(InternalBinarySearch(arr, 0, sz, i * i, UptrLess), i);
+  for (uptr i = 0; i < kSize; i++)
+    ASSERT_EQ(InternalBinarySearch(arr, 0, kSize, i * i, UptrLess), i);
 
-  ASSERT_EQ(InternalBinarySearch(arr, 0, sz, 7, UptrLess), sz + 1);
+  ASSERT_EQ(InternalBinarySearch(arr, 0, kSize, 7, UptrLess), kSize + 1);
 }
 
 }  // namespace __sanitizer





More information about the llvm-commits mailing list