diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-02-04 07:03:24 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-02-04 07:03:24 +0000 |
commit | 9c02a276049cbd1d1511a88ebc7a22bb33658237 (patch) | |
tree | fe1428d48ffb3a0f8dc06216ea2dfe493e7369a7 /include/llvm/Support/Compiler.h | |
parent | f839eed5ea2bfd395256d60e15d1e31dbad6ca8b (diff) |
More MSan/ASan annotations.
This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains
fixes for 2 issues:
- X86JIT reads return address from stack, which MSan does not know is
initialized.
- bugpoint tests run binaries with RLIMIT_AS. This does not work with certain
Sanitizers.
We are no longer including config.h in Compiler.h with this change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r-- | include/llvm/Support/Compiler.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index 6ca86bdd50..61c40f4a19 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -15,7 +15,7 @@ #ifndef LLVM_SUPPORT_COMPILER_H #define LLVM_SUPPORT_COMPILER_H -#include "llvm/Config/config.h" +#include "llvm/Config/llvm-config.h" #ifndef __has_feature # define __has_feature(x) 0 @@ -295,12 +295,11 @@ # define LLVM_FUNCTION_NAME __func__ #endif -/// \macro LLVM_ENABLE_MSAN_ANNOTATIONS -/// \brief Are MemorySanitizer annotations available. -#if defined(HAVE_SANITIZER_MSAN_INTERFACE_H) +#if defined(LLVM_HAVE_MSAN_ANNOTATIONS) # include <sanitizer/msan_interface.h> #else # define __msan_allocated_memory(p, size) +# define __msan_unpoison(p, size) #endif /// \macro LLVM_MEMORY_SANITIZER_BUILD @@ -311,6 +310,14 @@ # define LLVM_MEMORY_SANITIZER_BUILD 0 #endif +/// \macro LLVM_ADDRESS_SANITIZER_BUILD +/// \brief Whether LLVM itself is built with AddressSanitizer instrumentation. +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +# define LLVM_ADDRESS_SANITIZER_BUILD 1 +#else +# define LLVM_ADDRESS_SANITIZER_BUILD 0 +#endif + /// \macro LLVM_IS_UNALIGNED_ACCESS_FAST /// \brief Is unaligned memory access fast on the host machine. /// |