Skip to content

[docs] Document the missing availability platforms and environments #104653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 56 additions & 30 deletions clang/include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading