[libcxx-commits] [libcxx] [libc++] Add availability markup for LLVM 19 (PR #140072)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 31 12:59:03 PDT 2025
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/140072
>From 4578bc5f9c33f2ca2f9a4be0624b5fccdb50126f Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 15 May 2025 10:53:18 -0400
Subject: [PATCH 1/2] [libc++] Add availability markup for LLVM 19
An LLVM 19-aligned libc++ was released with macOS 15.4 (and
corresponding OSes). This patch adds availability markup to
reflect that.
---
libcxx/include/__configuration/availability.h | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/libcxx/include/__configuration/availability.h b/libcxx/include/__configuration/availability.h
index d0414ecfac2bb..d69b39be8b96b 100644
--- a/libcxx/include/__configuration/availability.h
+++ b/libcxx/include/__configuration/availability.h
@@ -123,9 +123,21 @@
# define _LIBCPP_INTRODUCED_IN_LLVM_20_ATTRIBUTE __attribute__((unavailable))
// LLVM 19
-// TODO: Fill this in
-# define _LIBCPP_INTRODUCED_IN_LLVM_19 0
-# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE __attribute__((unavailable))
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150400) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 180400) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 180400) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 110400) || \
+ (defined(__ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ < 90400)
+# define _LIBCPP_INTRODUCED_IN_LLVM_19 0
+# else
+# define _LIBCPP_INTRODUCED_IN_LLVM_19 1
+# endif
+# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE \
+ __attribute__((availability(macos, strict, introduced = 15.4))) \
+ __attribute__((availability(ios, strict, introduced = 18.4))) \
+ __attribute__((availability(tvos, strict, introduced = 18.4))) \
+ __attribute__((availability(watchos, strict, introduced = 11.4))) \
+ __attribute__((availability(bridgeos, strict, introduced = 9.4)))
// LLVM 18
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) || \
>From 310f9956c60149a4ee29489790376d4bab1da92f Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 15 May 2025 11:04:35 -0400
Subject: [PATCH 2/2] Add forgotten Lit features
---
libcxx/utils/libcxx/test/features.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 7d6e78de343c5..a1deb3a3f746d 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -733,17 +733,24 @@ def check_gdb(cfg):
# Helpers to define correspondances between LLVM versions and vendor system versions.
# Those are used for backdeployment features below, do not use directly in tests.
DEFAULT_FEATURES += [
+ Feature(
+ name="_target-has-llvm-19",
+ when=lambda cfg: BooleanExpression.evaluate(
+ "_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\d+)?}}",
+ cfg.available_features,
+ ),
+ ),
Feature(
name="_target-has-llvm-18",
when=lambda cfg: BooleanExpression.evaluate(
- "target={{.+}}-apple-macosx{{15(.[0-9]+)?(.[0-9]+)?}}",
+ "_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\d+)?}}",
cfg.available_features,
),
),
Feature(
name="_target-has-llvm-17",
when=lambda cfg: BooleanExpression.evaluate(
- "_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.[0-9]+)?}} || target={{.+}}-apple-macosx{{1[5-9]([.].+)?}}",
+ "_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\d+)?}}",
cfg.available_features,
),
),
More information about the libcxx-commits
mailing list