[clang] [docs] Document the missing availability platforms and environments (PR #104653)
Ian Anderson via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 26 16:58:16 PDT 2024
https://github.com/ian-twilightcoder updated https://github.com/llvm/llvm-project/pull/104653
>From b009556b34503b85be2d9312f918f84d987a999f Mon Sep 17 00:00:00 2001
From: Ian Anderson <iana at apple.com>
Date: Fri, 16 Aug 2024 17:32:29 -0700
Subject: [PATCH] [docs] Document the missing availability platforms and
environments
Update the availability attribute documentation to include all of the missing platforms, and add in the environments.
---
clang/include/clang/Basic/AttrDocs.td | 86 +++++++++++++++++----------
1 file changed, 56 insertions(+), 30 deletions(-)
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index df36a2163b9f0b..c2b9d7cb93c309 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -1592,6 +1592,12 @@ succeeds but Clang emits a warning specifying that the function is deprecated.
Finally, if Clang is instructed to compile code for macOS 10.7, the call
fails because ``f()`` is no longer available.
+Clang is instructed to compile code for a minimum deployment version using
+the ``-target`` or ``-mtargetos`` command line arguments. For example,
+macOS 10.7 would be specified as ``-target x86_64-apple-macos10.7`` or
+``-mtargetos=macos10.7``. Variants like Mac Catalyst are specified as
+``-target arm64-apple-ios15.0-macabi`` or ``-mtargetos=ios15.0-macabi``
+
The availability attribute is a comma-separated list starting with the
platform name and then including clauses specifying important milestones in the
declaration's lifetime (in any order) along with additional information. Those
@@ -1636,41 +1642,61 @@ the implicitly inferred availability attributes. If no availability attribute
specifies availability for the current target platform, the availability
attributes are ignored. Supported platforms are:
-``ios``
- Apple's iOS operating system. The minimum deployment target is specified
- as part of the ``-target *arch*-apple-ios*version*`` command line argument.
- Alternatively, it can be specified by the ``-mtargetos=ios*version*``
- command-line argument.
+``iOS``
+``macOS``
+``tvOS``
+``watchOS``
+``iOSApplicationExtension``
+``macOSApplicationExtension``
+``tvOSApplicationExtension``
+``watchOSApplicationExtension``
+``macCatalyst``
+``macCatalystApplicationExtension``
+``visionOS``
+``visionOSApplicationExtension``
+``driverkit``
+``swift``
+``android``
+``fuchsia``
+``ohos``
+``zos``
+``ShaderModel``
-``macos``
- Apple's macOS operating system. The minimum deployment target is specified
- as part of the ``-target *arch*-apple-macos*version*`` command line argument.
- Alternatively, it can be specified by the ``-mtargetos=macos*version*``
- command-line argument. ``macosx`` is supported for
- backward-compatibility reasons, but it is deprecated.
+Some platforms have alias names:
+``ios``
+``macos``
+``macosx (deprecated)``
``tvos``
- Apple's tvOS operating system. The minimum deployment target is specified
- as part of the ``-target *arch*-apple-tvos*version*`` command line argument.
- Alternatively, it can be specified by the ``-mtargetos=tvos*version*``
- command-line argument.
-
``watchos``
- Apple's watchOS operating system. The minimum deployment target is specified
- as part of the ``-target *arch*-apple-watchos*version*`` command line argument.
- Alternatively, it can be specified by the ``-mtargetos=watchos*version*``
- command-line argument.
-
+``ios_app_extension``
+``macos_app_extension``
+``macosx_app_extension (deprecated)``
+``tvos_app_extension``
+``watchos_app_extension``
+``maccatalyst``
+``maccatalyst_app_extension``
``visionos``
- Apple's visionOS operating system. The minimum deployment target is specified
- as part of the ``-target *arch*-apple-visionos*version*`` command line argument.
- Alternatively, it can be specified by the ``-mtargetos=visionos*version*``
- command-line argument.
-
-``driverkit``
- Apple's DriverKit userspace kernel extensions. The minimum deployment target
- is specified as part of the ``-target *arch*-apple-driverkit*version*``
- command line argument.
+``visionos_app_extension``
+``shadermodel``
+
+Supported environment names for the ShaderModel platform:
+
+``pixel``
+``vertex``
+``geometry``
+``hull``
+``domain``
+``compute``
+``raygeneration``
+``intersection``
+``anyhit``
+``closesthit``
+``miss``
+``callable``
+``mesh``
+``amplification``
+``library``
A declaration can typically be used even when deploying back to a platform
version prior to when the declaration was introduced. When this happens, the
More information about the cfe-commits
mailing list