[libcxx-commits] [PATCH] D103705: [libc++] Simplify a few macros in __config

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 4 11:06:01 PDT 2021


ldionne added subscribers: vitalybuka, EricWF, phosek.
ldionne added inline comments.


================
Comment at: libcxx/include/__config:493
 
-#if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
+#if !__has_feature(address_sanitizer)
 #define _LIBCPP_HAS_NO_ASAN
----------------
@vitalybuka Just pinging you in case you can think of someone that might be broken by this (i.e. they would have to manually define `_LIBCPP_HAS_NO_ASAN` on a compiler that pretends that `__has_feature(address_sanitizer)` is true).


================
Comment at: libcxx/include/__config:810
 
-#ifndef _LIBCPP_PREFERRED_OVERLOAD
-#  if __has_attribute(__enable_if__)
-#    define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
-#  endif
+#if __has_attribute(__enable_if__)
+#   define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
----------------
@EricWF In case you know someone that defines `_LIBCPP_PREFERRED_OVERLOAD` to something else manually?


================
Comment at: libcxx/include/__config:1300
-#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION
-#  ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
-#    define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
----------------
This looks like a bug to me, but I'm not sure who added those thread safety annotations or when they are used. @phosek I have a feeling I've seen you touch those at some point?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103705/new/

https://reviews.llvm.org/D103705



More information about the libcxx-commits mailing list