[libcxx-commits] [libcxx] [libc++] Add availability markup for LLVM 19 (PR #140072)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 2 10:00:38 PDT 2025
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/140072
>From 355f46c850325202326a3df90109793e70c41fdf 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 bbcdfdc784e9d..78969c3a1cc1d 100644
--- a/libcxx/include/__configuration/availability.h
+++ b/libcxx/include/__configuration/availability.h
@@ -134,9 +134,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 6e2e326634bba45cd7be0b35fa2e7e5d8d51bc04 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 10fc4b0afde6b..8aca0cb052449 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -724,17 +724,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