-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
ldionne
merged 1 commit into
llvm:main
from
ldionne:review/availability-attribute-naming
May 7, 2024
Merged
[libc++] Rename _LIBCPP_INTRODUCED_foo_MARKUP to _LIBCPP_INTRODUCED_foo_ATTRIBUTE #91269
ldionne
merged 1 commit into
llvm:main
from
ldionne:review/availability-attribute-naming
May 7, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…oo_ATTRIBUTE This was discussed in llvm#87563 and overlooked when I landed the patch.
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesThis was discussed in #87563 and overlooked when I landed the patch. Full diff: https://github.com/llvm/llvm-project/pull/91269.diff 1 Files Affected:
diff --git a/libcxx/include/__availability b/libcxx/include/__availability
index 7a02ae00846bfa..e44ac1962df363 100644
--- a/libcxx/include/__availability
+++ b/libcxx/include/__availability
@@ -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
@@ -134,18 +134,18 @@
(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") \
@@ -153,9 +153,9 @@
// 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
@@ -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
@@ -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
@@ -202,19 +202,19 @@
(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) || \
@@ -222,34 +222,34 @@
(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
@@ -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
@@ -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.
@@ -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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was discussed in #87563 and overlooked when I landed the patch.