Define a new macro in libc++ named '_LIBCPP_HAS_NO_ASAN'. When this is defined,

libc++ will not call address_sanitizer to detect addressing errors in the
standard library containers. This is a negative macro to enable users to
disable the libc++ checks even if they are compiling with address sanitizer
enabled by defining this macro.

At the present time, there is no code in libc++ that looks at this macro.
That will come soon. This is just infrastructure.

llvm-svn: 206184
This commit is contained in:
Marshall Clow 2014-04-14 15:44:57 +00:00
parent 3d84935d28
commit 91c71ddd8d

View File

@ -352,6 +352,10 @@ namespace std {
}
}
#if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
#define _LIBCPP_HAS_NO_ASAN
#endif
#elif defined(__GNUC__)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@ -426,6 +430,10 @@ namespace _LIBCPP_NAMESPACE {
using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
}
#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__)
#define _LIBCPP_HAS_NO_ASAN
#endif
#elif defined(_LIBCPP_MSVC)
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
@ -451,6 +459,8 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
namespace std {
}
#define _LIBCPP_HAS_NO_ASAN
#elif defined(__IBMCPP__)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@ -483,6 +493,8 @@ namespace std {
}
}
#define _LIBCPP_HAS_NO_ASAN
#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS