[sanitizer] Rename 2 files *.h->*.inc as appropriate.

Also add a missing include.

llvm-svn: 172814
This commit is contained in:
Evgeniy Stepanov 2013-01-18 13:01:18 +00:00
parent 46c5a5549e
commit a6c4a387ee
7 changed files with 34 additions and 18 deletions

View File

@ -93,7 +93,7 @@ using namespace __asan; // NOLINT
#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;

View File

@ -743,7 +743,7 @@ INTERCEPTOR(int, getrusage, int who, void *usage) {
#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) {

View File

@ -29,8 +29,8 @@ set(SANITIZER_HEADERS
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

View File

@ -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 @@ INTERCEPTOR(int, prctl, int option,
#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 @@ INTERCEPTOR(int, sscanf, const char *str, const char *format, ...) { // NOLINT
INIT_PREAD64; \
INIT_PRCTL; \
INIT_WRITE; \
INIT_SCANF; \
#endif // SANITIZER_COMMON_INTERCEPTORS_H
INIT_SCANF;

View File

@ -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 @@ static void scanf_common(void *ctx, const char *format, va_list ap_const) {
}
va_end(aq);
}
#endif // SANITIZER_COMMON_INTERCEPTORS_SCANF_H

View File

@ -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 @@ using namespace __sanitizer;
#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;

View File

@ -1618,7 +1618,7 @@ struct TsanInterceptorContext {
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 {