[clang] Add support for anyAppleOS availability (PR #181953)

Allan Shortlidge via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 25 08:28:59 PDT 2026


================
@@ -2697,6 +2698,70 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
     }
   }
 
+  // Handle anyAppleOS specially: create implicit platform-specific attributes
----------------
tshortli wrote:

This approach still feels pretty awkward to me. When developers look at a Swift projection of an Obj-C/C API with `anyAppleOS` availability, we should show them a single `anyAppleOS` availability attribute, as it was written in source. If Clang always pre-expands the attribute, Swift's ClangImporter would have to reverse the expansion to infer that the platform specific attributes actually came from an `anyAppleOS` attribute written in source.

https://github.com/llvm/llvm-project/pull/181953


More information about the cfe-commits mailing list