[llvm-commits] [compiler-rt] r172814 - in /compiler-rt/trunk/lib: asan/asan_interceptors.cc msan/msan_interceptors.cc sanitizer_common/CMakeLists.txt sanitizer_common/sanitizer_common_interceptors.h sanitizer_common/sanitizer_common_interceptors.inc sanitizer_common/sanitizer_common_interceptors_scanf.h sanitizer_common/sanitizer_common_interceptors_scanf.inc sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc tsan/rtl/tsan_interceptors.cc

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Jan 18 05:01:18 PST 2013


Author: eugenis
Date: Fri Jan 18 07:01:18 2013
New Revision: 172814

URL: http://llvm.org/viewvc/llvm-project?rev=172814&view=rev
Log:
[sanitizer] Rename 2 files *.h->*.inc as appropriate.

Also add a missing include.


Added:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
      - copied, changed from r172808, compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc
      - copied, changed from r172808, compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h
Removed:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h
Modified:
    compiler-rt/trunk/lib/asan/asan_interceptors.cc
    compiler-rt/trunk/lib/msan/msan_interceptors.cc
    compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc
    compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc

Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=172814&r1=172813&r2=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Fri Jan 18 07:01:18 2013
@@ -93,7 +93,7 @@
 #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)
-#include "sanitizer_common/sanitizer_common_interceptors.h"
+#include "sanitizer_common/sanitizer_common_interceptors.inc"
 
 static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) {
   AsanThread *t = (AsanThread*)arg;

Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=172814&r1=172813&r2=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Fri Jan 18 07:01:18 2013
@@ -743,7 +743,7 @@
 #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
-#include "sanitizer_common/sanitizer_common_interceptors.h"
+#include "sanitizer_common/sanitizer_common_interceptors.inc"
 
 // static
 void *fast_memset(void *ptr, int c, SIZE_T n) {

Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=172814&r1=172813&r2=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Fri Jan 18 07:01:18 2013
@@ -29,8 +29,8 @@
   sanitizer_atomic_msvc.h
   sanitizer_atomic.h
   sanitizer_common.h
-  sanitizer_common_interceptors.h
-  sanitizer_common_interceptors_scanf.h
+  sanitizer_common_interceptors.inc
+  sanitizer_common_interceptors_scanf.inc
   sanitizer_flags.h
   sanitizer_internal_defs.h
   sanitizer_lfstack.h

Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h?rev=172813&view=auto
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h (removed)
@@ -1,229 +0,0 @@
-//===-- sanitizer_common_interceptors.h -------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Common function interceptors for tools like AddressSanitizer,
-// ThreadSanitizer, MemorySanitizer, etc.
-//
-// This file should be included into the tool's interceptor file,
-// which has to define it's own macros:
-//   COMMON_INTERCEPTOR_ENTER
-//   COMMON_INTERCEPTOR_READ_RANGE
-//   COMMON_INTERCEPTOR_WRITE_RANGE
-//   COMMON_INTERCEPTOR_FD_ACQUIRE
-//   COMMON_INTERCEPTOR_FD_RELEASE
-//   COMMON_INTERCEPTOR_SET_THREAD_NAME
-//===----------------------------------------------------------------------===//
-#ifndef SANITIZER_COMMON_INTERCEPTORS_H
-#define SANITIZER_COMMON_INTERCEPTORS_H
-
-#include "interception/interception.h"
-#include "sanitizer_platform_interceptors.h"
-
-#include <stdarg.h>
-
-#if SANITIZER_INTERCEPT_READ
-INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, read, fd, ptr, count);
-  SSIZE_T res = REAL(read)(fd, ptr, count);
-  if (res > 0)
-    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
-  if (res >= 0 && fd >= 0)
-    COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
-  return res;
-}
-# define INIT_READ INTERCEPT_FUNCTION(read)
-#else
-# define INIT_READ
-#endif
-
-#if SANITIZER_INTERCEPT_PREAD
-INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, pread, fd, ptr, count, offset);
-  SSIZE_T res = REAL(pread)(fd, ptr, count, offset);
-  if (res > 0)
-    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
-  if (res >= 0 && fd >= 0)
-    COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
-  return res;
-}
-# define INIT_PREAD INTERCEPT_FUNCTION(pread)
-#else
-# define INIT_PREAD
-#endif
-
-#if SANITIZER_INTERCEPT_PREAD64
-INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, pread64, fd, ptr, count, offset);
-  SSIZE_T res = REAL(pread64)(fd, ptr, count, offset);
-  if (res > 0)
-    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
-  if (res >= 0 && fd >= 0)
-    COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
-  return res;
-}
-# define INIT_PREAD64 INTERCEPT_FUNCTION(pread64)
-#else
-# define INIT_PREAD64
-#endif
-
-#if SANITIZER_INTERCEPT_WRITE
-INTERCEPTOR(SSIZE_T, write, int fd, void *ptr, SIZE_T count) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, write, fd, ptr, count);
-  if (fd >= 0)
-    COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
-  SSIZE_T res = REAL(write)(fd, ptr, count);
-  if (res > 0)
-    COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res);
-  return res;
-}
-# define INIT_WRITE INTERCEPT_FUNCTION(write)
-#else
-# define INIT_WRITE
-#endif
-
-#if SANITIZER_INTERCEPT_PWRITE
-INTERCEPTOR(SSIZE_T, pwrite, int fd, void *ptr, SIZE_T count) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, pwrite, fd, ptr, count);
-  if (fd >= 0)
-    COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
-  SSIZE_T res = REAL(pwrite)(fd, ptr, count);
-  if (res > 0)
-    COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res);
-  return res;
-}
-# define INIT_PWRITE INTERCEPT_FUNCTION(pwrite)
-#else
-# define INIT_PWRITE
-#endif
-
-#if SANITIZER_INTERCEPT_PWRITE64
-INTERCEPTOR(SSIZE_T, pwrite64, int fd, void *ptr, OFF64_T count) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, pwrite64, fd, ptr, count);
-  if (fd >= 0)
-    COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
-  SSIZE_T res = REAL(pwrite64)(fd, ptr, count);
-  if (res > 0)
-    COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res);
-  return res;
-}
-# define INIT_PWRITE64 INTERCEPT_FUNCTION(pwrite64)
-#else
-# define INIT_PWRITE64
-#endif
-
-#if SANITIZER_INTERCEPT_PRCTL
-INTERCEPTOR(int, prctl, int option,
-            unsigned long arg2, unsigned long arg3,  // NOLINT
-            unsigned long arg4, unsigned long arg5) {  // NOLINT
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, prctl, option, arg2, arg3, arg4, arg5);
-  static const int PR_SET_NAME = 15;
-  int res = REAL(prctl(option, arg2, arg3, arg4, arg5));
-  if (option == PR_SET_NAME) {
-    char buff[16];
-    internal_strncpy(buff, (char*)arg2, 15);
-    buff[15] = 0;
-    COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, buff);
-  }
-  return res;
-}
-# define INIT_PRCTL INTERCEPT_FUNCTION(prctl)
-#else
-# define INIT_PRCTL
-#endif  // SANITIZER_INTERCEPT_PRCTL
-
-
-#if SANITIZER_INTERCEPT_SCANF
-
-#include "sanitizer_common_interceptors_scanf.h"
-
-INTERCEPTOR(int, vscanf, const char *format, va_list ap) {  // NOLINT
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, vscanf, format, ap);
-  scanf_common(ctx, format, ap);
-  int res = REAL(vscanf)(format, ap);  // NOLINT
-  return res;
-}
-
-INTERCEPTOR(int, vsscanf, const char *str, const char *format,  // NOLINT
-    va_list ap) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, vsscanf, str, format, ap);
-  scanf_common(ctx, format, ap);
-  int res = REAL(vsscanf)(str, format, ap);  // NOLINT
-  // FIXME: read of str
-  return res;
-}
-
-INTERCEPTOR(int, vfscanf, void *stream, const char *format,  // NOLINT
-    va_list ap) {
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, vfscanf, stream, format, ap);
-  scanf_common(ctx, format, ap);
-  int res = REAL(vfscanf)(stream, format, ap);  // NOLINT
-  return res;
-}
-
-INTERCEPTOR(int, scanf, const char *format, ...) {  // NOLINT
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, scanf, format);
-  va_list ap;
-  va_start(ap, format);
-  int res = vscanf(format, ap);  // NOLINT
-  va_end(ap);
-  return res;
-}
-
-INTERCEPTOR(int, fscanf, void* stream, const char *format, ...) {  // NOLINT
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, fscanf, stream, format);
-  va_list ap;
-  va_start(ap, format);
-  int res = vfscanf(stream, format, ap);  // NOLINT
-  va_end(ap);
-  return res;
-}
-
-INTERCEPTOR(int, sscanf, const char *str, const char *format, ...) {  // NOLINT
-  void* ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, sscanf, str, format);
-  va_list ap;
-  va_start(ap, format);
-  int res = vsscanf(str, format, ap);  // NOLINT
-  va_end(ap);
-  return res;
-}
-
-#define INIT_SCANF \
-  INTERCEPT_FUNCTION(scanf); \
-  INTERCEPT_FUNCTION(sscanf); \
-  INTERCEPT_FUNCTION(fscanf); \
-  INTERCEPT_FUNCTION(vscanf); \
-  INTERCEPT_FUNCTION(vsscanf); \
-  INTERCEPT_FUNCTION(vfscanf)
-
-#else
-#define INIT_SCANF
-#endif
-
-#define SANITIZER_COMMON_INTERCEPTORS_INIT \
-  INIT_READ;                               \
-  INIT_PREAD;                              \
-  INIT_PREAD64;                            \
-  INIT_PRCTL;                              \
-  INIT_WRITE;                              \
-  INIT_SCANF;                              \
-
-#endif  // SANITIZER_COMMON_INTERCEPTORS_H

Copied: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (from r172808, compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?p2=compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc&p1=compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h&r1=172808&r2=172814&rev=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Fri Jan 18 07:01:18 2013
@@ -1,4 +1,4 @@
-//===-- sanitizer_common_interceptors.h -------------------------*- C++ -*-===//
+//===-- sanitizer_common_interceptors.inc -----------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -19,9 +19,6 @@
 //   COMMON_INTERCEPTOR_FD_RELEASE
 //   COMMON_INTERCEPTOR_SET_THREAD_NAME
 //===----------------------------------------------------------------------===//
-#ifndef SANITIZER_COMMON_INTERCEPTORS_H
-#define SANITIZER_COMMON_INTERCEPTORS_H
-
 #include "interception/interception.h"
 #include "sanitizer_platform_interceptors.h"
 
@@ -147,7 +144,7 @@
 
 #if SANITIZER_INTERCEPT_SCANF
 
-#include "sanitizer_common_interceptors_scanf.h"
+#include "sanitizer_common_interceptors_scanf.inc"
 
 INTERCEPTOR(int, vscanf, const char *format, va_list ap) {  // NOLINT
   void* ctx;
@@ -224,6 +221,4 @@
   INIT_PREAD64;                            \
   INIT_PRCTL;                              \
   INIT_WRITE;                              \
-  INIT_SCANF;                              \
-
-#endif  // SANITIZER_COMMON_INTERCEPTORS_H
+  INIT_SCANF;

Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h?rev=172813&view=auto
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h (removed)
@@ -1,133 +0,0 @@
-#ifndef SANITIZER_COMMON_INTERCEPTORS_SCANF_H
-#define SANITIZER_COMMON_INTERCEPTORS_SCANF_H
-
-struct ScanfSpec {
-  char c;
-  unsigned size;
-};
-
-// One-letter specs.
-static const ScanfSpec scanf_specs[] = {
-  {'p', sizeof(void *)},
-  {'e', sizeof(float)},
-  {'E', sizeof(float)},
-  {'a', sizeof(float)},
-  {'f', sizeof(float)},
-  {'g', sizeof(float)},
-  {'d', sizeof(int)},
-  {'i', sizeof(int)},
-  {'o', sizeof(int)},
-  {'u', sizeof(int)},
-  {'x', sizeof(int)},
-  {'X', sizeof(int)},
-  {'n', sizeof(int)},
-  {'t', sizeof(PTRDIFF_T)},
-  {'z', sizeof(SIZE_T)},
-  {'j', sizeof(INTMAX_T)},
-  {'h', sizeof(short)}
-};
-
-static const unsigned scanf_specs_cnt =
-  sizeof(scanf_specs) / sizeof(scanf_specs[0]);
-
-// %ll?, %L?, %q? specs
-static const ScanfSpec scanf_llspecs[] = {
-  {'e', sizeof(long double)},
-  {'f', sizeof(long double)},
-  {'g', sizeof(long double)},
-  {'d', sizeof(long long)},
-  {'i', sizeof(long long)},
-  {'o', sizeof(long long)},
-  {'u', sizeof(long long)},
-  {'x', sizeof(long long)}
-};
-
-static const unsigned scanf_llspecs_cnt =
-  sizeof(scanf_llspecs) / sizeof(scanf_llspecs[0]);
-
-// %l? specs
-static const ScanfSpec scanf_lspecs[] = {
-  {'e', sizeof(double)},
-  {'f', sizeof(double)},
-  {'g', sizeof(double)},
-  {'d', sizeof(long)},
-  {'i', sizeof(long)},
-  {'o', sizeof(long)},
-  {'u', sizeof(long)},
-  {'x', sizeof(long)},
-  {'X', sizeof(long)},
-};
-
-static const unsigned scanf_lspecs_cnt =
-  sizeof(scanf_lspecs) / sizeof(scanf_lspecs[0]);
-
-static unsigned match_spec(const struct ScanfSpec *spec, unsigned n, char c) {
-  for (unsigned i = 0; i < n; ++i)
-    if (spec[i].c == c)
-      return spec[i].size;
-  return 0;
-}
-
-static void scanf_common(void *ctx, const char *format, va_list ap_const) {
-  va_list aq;
-  va_copy(aq, ap_const);
-
-  const char *p = format;
-  unsigned size;
-
-  while (*p) {
-    if (*p != '%') {
-      ++p;
-      continue;
-    }
-    ++p;
-    if (*p == '*' || *p == '%' || *p == 0) {
-      ++p;
-      continue;
-    }
-    if (*p == '0' || (*p >= '1' && *p <= '9')) {
-      size = internal_atoll(p);
-      // +1 for the \0 at the end
-      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, va_arg(aq, void *), size + 1);
-      ++p;
-      continue;
-    }
-    
-    if (*p == 'L' || *p == 'q') {
-      ++p;
-      size = match_spec(scanf_llspecs, scanf_llspecs_cnt, *p);
-      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, va_arg(aq, void *), size);
-      continue;
-    }
-
-    if (*p == 'l') {
-      ++p;
-      if (*p == 'l') {
-        ++p;
-        size = match_spec(scanf_llspecs, scanf_llspecs_cnt, *p);
-        COMMON_INTERCEPTOR_WRITE_RANGE(ctx, va_arg(aq, void *), size);
-        continue;
-      } else {
-        size = match_spec(scanf_lspecs, scanf_lspecs_cnt, *p);
-        COMMON_INTERCEPTOR_WRITE_RANGE(ctx, va_arg(aq, void *), size);
-        continue;
-      }
-    }
-
-    if (*p == 'h' && *(p + 1) == 'h') {
-      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, va_arg(aq, void *), sizeof(char));
-      p += 2;
-      continue;
-    }
-
-    size = match_spec(scanf_specs, scanf_specs_cnt, *p);
-    if (size) {
-      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, va_arg(aq, void *), size);
-      ++p;
-      continue;
-    }
-  }
-  va_end(aq);
-}
-
-#endif  // SANITIZER_COMMON_INTERCEPTORS_SCANF_H

Copied: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc (from r172808, compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc?p2=compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc&p1=compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h&r1=172808&r2=172814&rev=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc Fri Jan 18 07:01:18 2013
@@ -1,5 +1,16 @@
-#ifndef SANITIZER_COMMON_INTERCEPTORS_SCANF_H
-#define SANITIZER_COMMON_INTERCEPTORS_SCANF_H
+//===-- sanitizer_common_interceptors_scanf.inc -----------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Scanf implementation for use in *Sanitizer interceptors.
+//
+//===----------------------------------------------------------------------===//
+#include <stdarg.h>
 
 struct ScanfSpec {
   char c;
@@ -129,5 +140,3 @@
   }
   va_end(aq);
 }
-
-#endif  // SANITIZER_COMMON_INTERCEPTORS_SCANF_H

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc?rev=172814&r1=172813&r2=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc Fri Jan 18 07:01:18 2013
@@ -1,3 +1,15 @@
+//===-- sanitizer_scanf_interceptor_test.cc -------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Tests for *scanf interceptors implementation in sanitizer_common.
+//
+//===----------------------------------------------------------------------===//
 #include <vector>
 
 #include "interception/interception.h"
@@ -10,7 +22,7 @@
 #define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \
   ((std::vector<unsigned> *)ctx)->push_back(size)
 
-#include "sanitizer_common/sanitizer_common_interceptors_scanf.h"
+#include "sanitizer_common/sanitizer_common_interceptors_scanf.inc"
 
 static void testScanf2(void *ctx, const char *format, ...) {
   va_list ap;

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=172814&r1=172813&r2=172814&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Fri Jan 18 07:01:18 2013
@@ -1618,7 +1618,7 @@
     FdRelease(((TsanInterceptorContext*)ctx)->thr, pc, fd)
 #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \
     ThreadSetName(((TsanInterceptorContext*)ctx)->thr, name)
-#include "sanitizer_common/sanitizer_common_interceptors.h"
+#include "sanitizer_common/sanitizer_common_interceptors.inc"
 
 namespace __tsan {
 





More information about the llvm-commits mailing list