[libcxx] r206184 - Define a new macro in libc++ named '_LIBCPP_HAS_NO_ASAN'. When this is defined,

Marshall Clow mclow.lists at gmail.com
Mon Apr 14 08:44:57 PDT 2014


Author: marshall
Date: Mon Apr 14 10:44:57 2014
New Revision: 206184

URL: http://llvm.org/viewvc/llvm-project?rev=206184&view=rev
Log:
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.

Modified:
    libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=206184&r1=206183&r2=206184&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Mon Apr 14 10:44:57 2014
@@ -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 __attr
 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





More information about the cfe-commits mailing list