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 | 1f5a71492de40dcb9d150815c84506842b3d17b8 (patch) | |
| tree | 1bf83d476fc486d013493fe1e19e0dfc423c9fce /llvm/include | |
| parent | 2811f8ac2828dbc96839f6404142a6513a4e4153 (diff) | |
| download | bcm5719-llvm-1f5a71492de40dcb9d150815c84506842b3d17b8.tar.gz bcm5719-llvm-1f5a71492de40dcb9d150815c84506842b3d17b8.zip | |
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.
llvm-svn: 174306
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Config/config.h.cmake | 3 | ||||
| -rw-r--r-- | llvm/include/llvm/Config/llvm-config.h.cmake | 3 | ||||
| -rw-r--r-- | llvm/include/llvm/Support/Compiler.h | 15 |
3 files changed, 14 insertions, 7 deletions
diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index b0b81042051..94870834313 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -468,9 +468,6 @@ /* Define to 1 if the system has the type `u_int64_t'. */ #cmakedefine HAVE_U_INT64_T ${HAVE_U_INT64_T} -/* Define to 1 if you have the <sanitizer/msan_interface.h> header file. */ -#cmakedefine HAVE_SANITIZER_MSAN_INTERFACE_H ${HAVE_SANITIZER_MSAN_INTERFACE_H} - /* Define to 1 if you have the <valgrind/valgrind.h> header file. */ #cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H} diff --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake index fbc3040dd2e..b2be7b4f072 100644 --- a/llvm/include/llvm/Config/llvm-config.h.cmake +++ b/llvm/include/llvm/Config/llvm-config.h.cmake @@ -124,4 +124,7 @@ /* Minor version of the LLVM API */ #cmakedefine LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR} +/* Define to 1 if you have the <sanitizer/msan_interface.h> header file. */ +#cmakedefine LLVM_HAVE_MSAN_ANNOTATIONS ${HAVE_SANITIZER_MSAN_INTERFACE_H} + #endif diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h index 6ca86bdd502..61c40f4a19a 100644 --- a/llvm/include/llvm/Support/Compiler.h +++ b/llvm/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. /// |

