[sanitizer] lint
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 18 Jan 2013 13:12:56 +0000 (13:12 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 18 Jan 2013 13:12:56 +0000 (13:12 +0000)
llvm-svn: 172817

compiler-rt/lib/asan/asan_intercepted_functions.h
compiler-rt/lib/asan/asan_interceptors.cc
compiler-rt/lib/msan/msan_interceptors.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc

index 403c491..a1faf71 100644 (file)
@@ -235,8 +235,9 @@ DECLARE_FUNCTION_AND_WRAPPER(int, vsscanf, const char *str, const char *format,
 DECLARE_FUNCTION_AND_WRAPPER(int, vfscanf, void *stream, const char *format,
                              va_list ap);
 DECLARE_FUNCTION_AND_WRAPPER(int, scanf, const char *format, ...);
-DECLARE_FUNCTION_AND_WRAPPER(int, fscanf, void* stream, const char *format, ...);
-DECLARE_FUNCTION_AND_WRAPPER(int, sscanf,
+DECLARE_FUNCTION_AND_WRAPPER(int, fscanf,
+                             void* stream, const char *format, ...);
+DECLARE_FUNCTION_AND_WRAPPER(int, sscanf,  // NOLINT
                              const char *str, const char *format, ...);
 
 #if MAC_INTERPOSE_FUNCTIONS && !defined(MISSING_BLOCKS_SUPPORT)
index 05038e8..6170974 100644 (file)
@@ -86,10 +86,15 @@ void SetThreadName(const char *name) {
 // ---------------------- Wrappers ---------------- {{{1
 using namespace __asan;  // NOLINT
 
-#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) ASAN_WRITE_RANGE(ptr, size)
+#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \
+  ASAN_WRITE_RANGE(ptr, size)
 #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) ASAN_READ_RANGE(ptr, size)
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
-  do {ctx = 0; (void)ctx; ENSURE_ASAN_INITED();} while (false)
+  do {                                           \
+    ctx = 0;                                     \
+    (void)ctx;                                   \
+    ENSURE_ASAN_INITED();                        \
+  } while (false)
 #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) do { } while (false)
 #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) do { } while (false)
 #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) SetThreadName(name)
index 69904dd..4629204 100644 (file)
@@ -739,10 +739,15 @@ INTERCEPTOR(int, getrusage, int who, void *usage) {
     __msan_unpoison(ptr, size)
 #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) do { } while (false)
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
-  do {ctx = 0; (void)ctx; ENSURE_MSAN_INITED();} while (false)
+  do {                                           \
+    ctx = 0;                                     \
+    (void)ctx;                                   \
+    ENSURE_MSAN_INITED();                        \
+  } while (false)
 #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) do { } while (false)
 #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) do { } while (false)
-#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) do { } while (false)  // FIXME
+#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \
+  do { } while (false)  // FIXME
 #include "sanitizer_common/sanitizer_common_interceptors.inc"
 
 // static
index 31d6d5d..00b2604 100644 (file)
@@ -51,13 +51,13 @@ static void testScanf(const char *format, unsigned n, ...) {
 }
 
 TEST(SanitizerCommonInterceptors, Scanf) {
-  const unsigned I = sizeof(int);
-  const unsigned L = sizeof(long);
-  const unsigned LL = sizeof(long long);
-  const unsigned S = sizeof(short);
-  const unsigned C = sizeof(char);
-  const unsigned D = sizeof(double);
-  const unsigned F = sizeof(float);
+  const unsigned I = sizeof(int);  // NOLINT
+  const unsigned L = sizeof(long);  // NOLINT
+  const unsigned LL = sizeof(long long);  // NOLINT
+  const unsigned S = sizeof(short);  // NOLINT
+  const unsigned C = sizeof(char);  // NOLINT
+  const unsigned D = sizeof(double);  // NOLINT
+  const unsigned F = sizeof(float);  // NOLINT
 
   testScanf("%d", 1, I);
   testScanf("%d%d%d", 3, I, I, I);
index c0846e7..be58ca9 100644 (file)
@@ -1611,7 +1611,8 @@ struct TsanInterceptorContext {
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
     SCOPED_TSAN_INTERCEPTOR(func, __VA_ARGS__) \
     TsanInterceptorContext _ctx = {thr, caller_pc, pc}; \
-    ctx = (void*)&_ctx; (void)ctx;
+    ctx = (void*)&_ctx; \
+    (void)ctx;
 #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \
     FdAcquire(((TsanInterceptorContext*)ctx)->thr, pc, fd)
 #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \