Skip to content

[libc++] Rename _LIBCPP_INTRODUCED_foo_MARKUP to _LIBCPP_INTRODUCED_foo_ATTRIBUTE #91269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions libcxx/include/__availability
Original file line number Diff line number Diff line change
Expand Up @@ -87,43 +87,43 @@
#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)

# define _LIBCPP_INTRODUCED_IN_LLVM_4 1
# define _LIBCPP_INTRODUCED_IN_LLVM_4_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_9 1
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_PUSH /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_POP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_10 1
# define _LIBCPP_INTRODUCED_IN_LLVM_10_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_10_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_12 1
# define _LIBCPP_INTRODUCED_IN_LLVM_12_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_14 1
# define _LIBCPP_INTRODUCED_IN_LLVM_14_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_15 1
# define _LIBCPP_INTRODUCED_IN_LLVM_15_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_16 1
# define _LIBCPP_INTRODUCED_IN_LLVM_16_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_16_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_18 1
# define _LIBCPP_INTRODUCED_IN_LLVM_18_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_19 1
# define _LIBCPP_INTRODUCED_IN_LLVM_19_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE /* nothing */

#elif defined(__APPLE__)

// LLVM 4
# if defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000
# define _LIBCPP_INTRODUCED_IN_LLVM_4 0
# define _LIBCPP_INTRODUCED_IN_LLVM_4_MARKUP __attribute__((availability(watchos, strict, introduced = 5.0)))
# define _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE __attribute__((availability(watchos, strict, introduced = 5.0)))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_4 1
# define _LIBCPP_INTRODUCED_IN_LLVM_4_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE /* nothing */
# endif

// LLVM 9
Expand All @@ -134,28 +134,28 @@
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000)
// clang-format on
# define _LIBCPP_INTRODUCED_IN_LLVM_9 0
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP \
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE \
__attribute__((availability(macos, strict, introduced = 10.15))) \
__attribute__((availability(ios, strict, introduced = 13.0))) \
__attribute__((availability(tvos, strict, introduced = 13.0))) \
__attribute__((availability(watchos, strict, introduced = 6.0)))
// clang-format off
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_PUSH \
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH \
_Pragma("clang attribute push(__attribute__((availability(macos,strict,introduced=10.15))), apply_to=any(function,record))") \
_Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
_Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
_Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_POP \
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop") \
_Pragma("clang attribute pop")
// clang-format on
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_9 1
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_PUSH /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_POP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP /* nothing */
# endif

// LLVM 10
Expand All @@ -166,14 +166,14 @@
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000)
// clang-format on
# define _LIBCPP_INTRODUCED_IN_LLVM_10 0
# define _LIBCPP_INTRODUCED_IN_LLVM_10_MARKUP \
# define _LIBCPP_INTRODUCED_IN_LLVM_10_ATTRIBUTE \
__attribute__((availability(macos, strict, introduced = 11.0))) \
__attribute__((availability(ios, strict, introduced = 14.0))) \
__attribute__((availability(tvos, strict, introduced = 14.0))) \
__attribute__((availability(watchos, strict, introduced = 7.0)))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_10 1
# define _LIBCPP_INTRODUCED_IN_LLVM_10_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_10_ATTRIBUTE /* nothing */
# endif

// LLVM 12
Expand All @@ -184,14 +184,14 @@
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 80000)
// clang-format on
# define _LIBCPP_INTRODUCED_IN_LLVM_12 0
# define _LIBCPP_INTRODUCED_IN_LLVM_12_MARKUP \
# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE \
__attribute__((availability(macos, strict, introduced = 12.0))) \
__attribute__((availability(ios, strict, introduced = 15.0))) \
__attribute__((availability(tvos, strict, introduced = 15.0))) \
__attribute__((availability(watchos, strict, introduced = 8.0)))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_12 1
# define _LIBCPP_INTRODUCED_IN_LLVM_12_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_12_ATTRIBUTE /* nothing */
# endif

// LLVM 14
Expand All @@ -202,54 +202,54 @@
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 90500)
// clang-format on
# define _LIBCPP_INTRODUCED_IN_LLVM_14 0
# define _LIBCPP_INTRODUCED_IN_LLVM_14_MARKUP \
# define _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE \
__attribute__((availability(macos, strict, introduced = 13.4))) \
__attribute__((availability(ios, strict, introduced = 16.5))) \
__attribute__((availability(tvos, strict, introduced = 16.5))) \
__attribute__((availability(watchos, strict, introduced = 9.5)))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_14 1
# define _LIBCPP_INTRODUCED_IN_LLVM_14_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE /* nothing */
# endif

// LLVM 15-16
# define _LIBCPP_INTRODUCED_IN_LLVM_15 _LIBCPP_INTRODUCED_IN_LLVM_16
# define _LIBCPP_INTRODUCED_IN_LLVM_15_MARKUP _LIBCPP_INTRODUCED_IN_LLVM_16_MARKUP
# define _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE _LIBCPP_INTRODUCED_IN_LLVM_16_ATTRIBUTE
// clang-format off
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000)
// clang-format on
# define _LIBCPP_INTRODUCED_IN_LLVM_16 0
# define _LIBCPP_INTRODUCED_IN_LLVM_16_MARKUP \
# define _LIBCPP_INTRODUCED_IN_LLVM_16_ATTRIBUTE \
__attribute__((availability(macos, strict, introduced = 14.0))) \
__attribute__((availability(ios, strict, introduced = 17.0))) \
__attribute__((availability(tvos, strict, introduced = 17.0))) \
__attribute__((availability(watchos, strict, introduced = 10.0)))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_16 1
# define _LIBCPP_INTRODUCED_IN_LLVM_16_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_16_ATTRIBUTE /* nothing */
# endif

// LLVM 18
// TODO: Fill this in
# if 1
# define _LIBCPP_INTRODUCED_IN_LLVM_18 0
# define _LIBCPP_INTRODUCED_IN_LLVM_18_MARKUP __attribute__((unavailable))
# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE __attribute__((unavailable))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_18 1
# define _LIBCPP_INTRODUCED_IN_LLVM_18_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE /* nothing */
# endif

// LLVM 19
// TODO: Fill this in
# if 1
# define _LIBCPP_INTRODUCED_IN_LLVM_19 0
# define _LIBCPP_INTRODUCED_IN_LLVM_19_MARKUP __attribute__((unavailable))
# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE __attribute__((unavailable))
# else
# define _LIBCPP_INTRODUCED_IN_LLVM_19 1
# define _LIBCPP_INTRODUCED_IN_LLVM_19_MARKUP /* nothing */
# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE /* nothing */
# endif

#else
Expand All @@ -270,27 +270,27 @@
// these exceptions can be used even on older deployment targets, but those
// methods will abort instead of throwing.
#define _LIBCPP_AVAILABILITY_HAS_BAD_OPTIONAL_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4_MARKUP
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE

#define _LIBCPP_AVAILABILITY_HAS_BAD_VARIANT_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4
#define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4_MARKUP
#define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE

#define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST _LIBCPP_INTRODUCED_IN_LLVM_4
#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_INTRODUCED_IN_LLVM_4_MARKUP
#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_INTRODUCED_IN_LLVM_4_ATTRIBUTE

// These macros control the availability of all parts of <filesystem> that
// depend on something in the dylib.
#define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9
#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP
#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_PUSH
#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP _LIBCPP_INTRODUCED_IN_LLVM_9_MARKUP_POP
#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE
#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_PUSH
#define _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP _LIBCPP_INTRODUCED_IN_LLVM_9_ATTRIBUTE_POP

// This controls the availability of the C++20 synchronization library,
// which requires shared library support for various operations
// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,
// <semaphore>, and notification functions on std::atomic.
#define _LIBCPP_AVAILABILITY_HAS_SYNC _LIBCPP_INTRODUCED_IN_LLVM_10
#define _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INTRODUCED_IN_LLVM_10_MARKUP
#define _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INTRODUCED_IN_LLVM_10_ATTRIBUTE

// Enable additional explicit instantiations of iostreams components. This
// reduces the number of weak definitions generated in programs that use
Expand All @@ -308,13 +308,13 @@
// This controls the availability of floating-point std::to_chars functions.
// These overloads were added later than the integer overloads.
#define _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14
#define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14_MARKUP
#define _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_INTRODUCED_IN_LLVM_14_ATTRIBUTE

// This controls whether the library claims to provide a default verbose
// termination function, and consequently whether the headers will try
// to use it when the mechanism isn't overriden at compile-time.
#define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15
#define _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15_MARKUP
#define _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_INTRODUCED_IN_LLVM_15_ATTRIBUTE

// This controls the availability of the C++17 std::pmr library,
// which is implemented in large part in the built library.
Expand All @@ -330,27 +330,27 @@
// in the built library, which std::make_exception_ptr might use
// (see libcxx/include/__exception/exception_ptr.h).
#define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18
#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18_MARKUP
#define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE

// This controls the availability of C++23 <print>, which
// has a dependency on the built library (it needs access to
// the underlying buffer types of std::cout, std::cerr, and std::clog.
#define _LIBCPP_AVAILABILITY_HAS_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18
#define _LIBCPP_AVAILABILITY_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18_MARKUP
#define _LIBCPP_AVAILABILITY_PRINT _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE

// This controls the availability of the C++20 time zone database.
// The parser code is built in the library.
#define _LIBCPP_AVAILABILITY_HAS_TZDB _LIBCPP_INTRODUCED_IN_LLVM_19
#define _LIBCPP_AVAILABILITY_TZDB _LIBCPP_INTRODUCED_IN_LLVM_19_MARKUP
#define _LIBCPP_AVAILABILITY_TZDB _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE

// These macros determine whether we assume that std::bad_function_call and
// std::bad_expected_access provide a key function in the dylib. This allows
// centralizing their vtable and typeinfo instead of having all TUs provide
// a weak definition that then gets deduplicated.
# define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19
# define _LIBCPP_AVAILABILITY_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_MARKUP
# define _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19
# define _LIBCPP_AVAILABILITY_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_MARKUP
#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19
#define _LIBCPP_AVAILABILITY_BAD_FUNCTION_CALL_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE
#define _LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19
#define _LIBCPP_AVAILABILITY_BAD_EXPECTED_ACCESS_KEY_FUNCTION _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE

// Define availability attributes that depend on _LIBCPP_HAS_NO_EXCEPTIONS.
// Those are defined in terms of the availability attributes above, and
Expand Down