Skip to content

Commit 4036413

Browse files
authored
[libc++] Add availability mapping for LLVM 18 on Apple platforms (#110158)
1 parent 45a09d1 commit 4036413

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

libcxx/include/__configuration/availability.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,19 @@
138138
# define _LIBCPP_INTRODUCED_IN_LLVM_19_ATTRIBUTE __attribute__((unavailable))
139139

140140
// LLVM 18
141-
// TODO: Fill this in
142-
# define _LIBCPP_INTRODUCED_IN_LLVM_18 0
143-
# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE __attribute__((unavailable))
141+
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 150000) || \
142+
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 180000) || \
143+
(defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 180000) || \
144+
(defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 110000)
145+
# define _LIBCPP_INTRODUCED_IN_LLVM_18 0
146+
# else
147+
# define _LIBCPP_INTRODUCED_IN_LLVM_18 1
148+
# endif
149+
# define _LIBCPP_INTRODUCED_IN_LLVM_18_ATTRIBUTE \
150+
__attribute__((availability(macos, strict, introduced = 15.0))) \
151+
__attribute__((availability(ios, strict, introduced = 18.0))) \
152+
__attribute__((availability(tvos, strict, introduced = 18.0))) \
153+
__attribute__((availability(watchos, strict, introduced = 11.0)))
144154

145155
// LLVM 17
146156
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140400) || \

libcxx/utils/libcxx/test/features.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,17 @@ def check_gdb(cfg):
610610
# Helpers to define correspondances between LLVM versions and vendor system versions.
611611
# Those are used for backdeployment features below, do not use directly in tests.
612612
DEFAULT_FEATURES += [
613+
Feature(
614+
name="_target-has-llvm-18",
615+
when=lambda cfg: BooleanExpression.evaluate(
616+
"target={{.+}}-apple-macosx{{15(.[0-9]+)?(.[0-9]+)?}}",
617+
cfg.available_features,
618+
),
619+
),
613620
Feature(
614621
name="_target-has-llvm-17",
615622
when=lambda cfg: BooleanExpression.evaluate(
616-
"target={{.+}}-apple-macosx{{14.[4-9](.0)?}} || target={{.+}}-apple-macosx{{1[5-9]([.].+)?}}",
623+
"_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.0)?}} || target={{.+}}-apple-macosx{{1[5-9]([.].+)?}}",
617624
cfg.available_features,
618625
),
619626
),

0 commit comments

Comments
 (0)