summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_internal_defs.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-06-27 21:00:23 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-06-27 21:00:23 +0000
commitd51a1a10cba87be50e9ada9fa21337c387edb237 (patch)
tree83aaaaaafc82638e3cb515e9f32946e8627337c3 /lib/sanitizer_common/sanitizer_internal_defs.h
parenta5562db12c5331433407ac21602086f34561c25c (diff)
downloadcompiler-rt-d51a1a10cba87be50e9ada9fa21337c387edb237.tar.gz
compiler-rt-d51a1a10cba87be50e9ada9fa21337c387edb237.tar.bz2
compiler-rt-d51a1a10cba87be50e9ada9fa21337c387edb237.tar.xz
tsan: prevent insertion of unwanted memset/memcpy/memcmp into runtime
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_internal_defs.h')
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index 5e0fb694..ea914abc 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -26,6 +26,7 @@ using namespace __sanitizer; // NOLINT
// Platform-specific defs.
#if defined(_WIN32)
typedef unsigned long DWORD; // NOLINT
+# define ALWAYS_INLINE __declspec(forceinline)
// FIXME(timurrrr): do we need this on Windows?
# define ALIAS(x)
# define ALIGNED(x) __declspec(align(x))
@@ -33,18 +34,24 @@ typedef unsigned long DWORD; // NOLINT
# define NOINLINE __declspec(noinline)
# define NORETURN __declspec(noreturn)
# define THREADLOCAL __declspec(thread)
+# define NOTHROW
#else // _WIN32
+# define ALWAYS_INLINE __attribute__((always_inline))
# define ALIAS(x) __attribute__((alias(x)))
# define ALIGNED(x) __attribute__((aligned(x)))
# define FORMAT(f, a) __attribute__((format(printf, f, a)))
# define NOINLINE __attribute__((noinline))
# define NORETURN __attribute__((noreturn))
# define THREADLOCAL __thread
+# ifdef __cplusplus
+# define NOTHROW throw()
+# else
+# define NOTHROW __attribute__((__nothrow__))
+#endif
#endif // _WIN32
// We have no equivalent of these on Windows.
#ifndef _WIN32
-# define ALWAYS_INLINE __attribute__((always_inline))
# define LIKELY(x) __builtin_expect(!!(x), 1)
# define UNLIKELY(x) __builtin_expect(!!(x), 0)
# define UNUSED __attribute__((unused))