From b584e193b59701a4aaf3173cbe5ae022b3f53843 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Thu, 20 Feb 2014 11:37:03 +0000 Subject: Unconditionally include msan_interface.h when building with MSan. Any version of Clang that does not provide this header is way too old to bootstrap with MSan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201776 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/config-ix.cmake | 1 - include/llvm/Config/llvm-config.h.cmake | 3 --- include/llvm/Support/Compiler.h | 10 +++------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 93aeae1003..5b945d1220 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -51,7 +51,6 @@ check_include_file(ndir.h HAVE_NDIR_H) if( NOT PURE_WINDOWS ) check_include_file(pthread.h HAVE_PTHREAD_H) endif() -check_include_file(sanitizer/msan_interface.h HAVE_SANITIZER_MSAN_INTERFACE_H) check_include_file(signal.h HAVE_SIGNAL_H) check_include_file(stdint.h HAVE_STDINT_H) check_include_file(sys/dir.h HAVE_SYS_DIR_H) diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake index 80616ef950..2b828a1ffb 100644 --- a/include/llvm/Config/llvm-config.h.cmake +++ b/include/llvm/Config/llvm-config.h.cmake @@ -121,7 +121,4 @@ /* Minor version of the LLVM API */ #cmakedefine LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR} -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SANITIZER_MSAN_INTERFACE_H ${HAVE_SANITIZER_MSAN_INTERFACE_H} - #endif diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index 49f2995434..d7621a0513 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -349,19 +349,15 @@ # define LLVM_FUNCTION_NAME __func__ #endif -#if defined(HAVE_SANITIZER_MSAN_INTERFACE_H) -# include -#else -# define __msan_allocated_memory(p, size) -# define __msan_unpoison(p, size) -#endif - /// \macro LLVM_MEMORY_SANITIZER_BUILD /// \brief Whether LLVM itself is built with MemorySanitizer instrumentation. #if __has_feature(memory_sanitizer) # define LLVM_MEMORY_SANITIZER_BUILD 1 +# include #else # define LLVM_MEMORY_SANITIZER_BUILD 0 +# define __msan_allocated_memory(p, size) +# define __msan_unpoison(p, size) #endif /// \macro LLVM_ADDRESS_SANITIZER_BUILD -- cgit v1.2.3