Skip to content

Commit 79154a9

Browse files
[docs] Document the missing availability platforms and environments (#104653)
Update the availability attribute documentation to include all of the missing platforms, and add in the environments.
1 parent bcde45b commit 79154a9

File tree

1 file changed

+56
-30
lines changed

1 file changed

+56
-30
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,12 @@ succeeds but Clang emits a warning specifying that the function is deprecated.
15921592
Finally, if Clang is instructed to compile code for macOS 10.7, the call
15931593
fails because ``f()`` is no longer available.
15941594

1595+
Clang is instructed to compile code for a minimum deployment version using
1596+
the ``-target`` or ``-mtargetos`` command line arguments. For example,
1597+
macOS 10.7 would be specified as ``-target x86_64-apple-macos10.7`` or
1598+
``-mtargetos=macos10.7``. Variants like Mac Catalyst are specified as
1599+
``-target arm64-apple-ios15.0-macabi`` or ``-mtargetos=ios15.0-macabi``
1600+
15951601
The availability attribute is a comma-separated list starting with the
15961602
platform name and then including clauses specifying important milestones in the
15971603
declaration's lifetime (in any order) along with additional information. Those
@@ -1636,41 +1642,61 @@ the implicitly inferred availability attributes. If no availability attribute
16361642
specifies availability for the current target platform, the availability
16371643
attributes are ignored. Supported platforms are:
16381644

1639-
``ios``
1640-
Apple's iOS operating system. The minimum deployment target is specified
1641-
as part of the ``-target *arch*-apple-ios*version*`` command line argument.
1642-
Alternatively, it can be specified by the ``-mtargetos=ios*version*``
1643-
command-line argument.
1645+
``iOS``
1646+
``macOS``
1647+
``tvOS``
1648+
``watchOS``
1649+
``iOSApplicationExtension``
1650+
``macOSApplicationExtension``
1651+
``tvOSApplicationExtension``
1652+
``watchOSApplicationExtension``
1653+
``macCatalyst``
1654+
``macCatalystApplicationExtension``
1655+
``visionOS``
1656+
``visionOSApplicationExtension``
1657+
``driverkit``
1658+
``swift``
1659+
``android``
1660+
``fuchsia``
1661+
``ohos``
1662+
``zos``
1663+
``ShaderModel``
16441664

1645-
``macos``
1646-
Apple's macOS operating system. The minimum deployment target is specified
1647-
as part of the ``-target *arch*-apple-macos*version*`` command line argument.
1648-
Alternatively, it can be specified by the ``-mtargetos=macos*version*``
1649-
command-line argument. ``macosx`` is supported for
1650-
backward-compatibility reasons, but it is deprecated.
1665+
Some platforms have alias names:
16511666

1667+
``ios``
1668+
``macos``
1669+
``macosx (deprecated)``
16521670
``tvos``
1653-
Apple's tvOS operating system. The minimum deployment target is specified
1654-
as part of the ``-target *arch*-apple-tvos*version*`` command line argument.
1655-
Alternatively, it can be specified by the ``-mtargetos=tvos*version*``
1656-
command-line argument.
1657-
16581671
``watchos``
1659-
Apple's watchOS operating system. The minimum deployment target is specified
1660-
as part of the ``-target *arch*-apple-watchos*version*`` command line argument.
1661-
Alternatively, it can be specified by the ``-mtargetos=watchos*version*``
1662-
command-line argument.
1663-
1672+
``ios_app_extension``
1673+
``macos_app_extension``
1674+
``macosx_app_extension (deprecated)``
1675+
``tvos_app_extension``
1676+
``watchos_app_extension``
1677+
``maccatalyst``
1678+
``maccatalyst_app_extension``
16641679
``visionos``
1665-
Apple's visionOS operating system. The minimum deployment target is specified
1666-
as part of the ``-target *arch*-apple-visionos*version*`` command line argument.
1667-
Alternatively, it can be specified by the ``-mtargetos=visionos*version*``
1668-
command-line argument.
1669-
1670-
``driverkit``
1671-
Apple's DriverKit userspace kernel extensions. The minimum deployment target
1672-
is specified as part of the ``-target *arch*-apple-driverkit*version*``
1673-
command line argument.
1680+
``visionos_app_extension``
1681+
``shadermodel``
1682+
1683+
Supported environment names for the ShaderModel platform:
1684+
1685+
``pixel``
1686+
``vertex``
1687+
``geometry``
1688+
``hull``
1689+
``domain``
1690+
``compute``
1691+
``raygeneration``
1692+
``intersection``
1693+
``anyhit``
1694+
``closesthit``
1695+
``miss``
1696+
``callable``
1697+
``mesh``
1698+
``amplification``
1699+
``library``
16741700

16751701
A declaration can typically be used even when deploying back to a platform
16761702
version prior to when the declaration was introduced. When this happens, the

0 commit comments

Comments
 (0)