From 3efd6fc26c1949f0e5ccf55e1d8653e313e8a003 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 15 Jun 2012 12:24:07 +0000 Subject: [Sanitizer] Use DEFINE_REAL macro in TSan runtime to call libc implementations of functions. Move strchr to sanitizer_libc. llvm-svn: 158517 --- compiler-rt/lib/tsan/rtl/tsan_defs.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'compiler-rt/lib/tsan/rtl/tsan_defs.h') diff --git a/compiler-rt/lib/tsan/rtl/tsan_defs.h b/compiler-rt/lib/tsan/rtl/tsan_defs.h index 117b245dee0..5127d5dc46f 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_defs.h +++ b/compiler-rt/lib/tsan/rtl/tsan_defs.h @@ -14,6 +14,7 @@ #ifndef TSAN_DEFS_H #define TSAN_DEFS_H +#include "interception/interception.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_libc.h" #include "tsan_stat.h" @@ -134,13 +135,6 @@ T RoundUp(T p, int align) { return (T)(((u64)p + align - 1) & ~(align - 1)); } -void real_memset(void *ptr, int c, uptr size); -void real_memcpy(void *dst, const void *src, uptr size); -int internal_strncmp(const char *s1, const char *s2, uptr size); -void internal_strcpy(char *s1, const char *s2); -const char *internal_strstr(const char *where, const char *what); -const char *internal_strchr(const char *where, char what); - struct MD5Hash { u64 hash[2]; bool operator==(const MD5Hash &other) const { @@ -160,4 +154,9 @@ class StackTrace; } // namespace __tsan +DECLARE_REAL(void*, memset, void *ptr, int v, uptr size); +DECLARE_REAL(void*, memcpy, void *dst, const void *src, uptr size); +DECLARE_REAL(int, strncmp, const char *s1, const char *s2, uptr n); +DECLARE_REAL(const char*, strstr, const char *s1, const char *s2); + #endif // TSAN_DEFS_H -- cgit v1.2.3