diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2024-03-07 13:06:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 13:06:30 -0800 |
commit | 9cf9cb271bf86bda4996be9a31fa413381f2f5e3 (patch) | |
tree | cdcd8e1994fb11f072f047e717f6a8b38533b0e1 /clang/lib/Parse/ParseDecl.cpp | |
parent | 143afb405a7e12e3fe1622b92f046ab2380c8981 (diff) | |
download | llvm-9cf9cb271bf86bda4996be9a31fa413381f2f5e3.zip llvm-9cf9cb271bf86bda4996be9a31fa413381f2f5e3.tar.gz llvm-9cf9cb271bf86bda4996be9a31fa413381f2f5e3.tar.bz2 |
[clang] Upstream visionOS Availability & DarwinSDKInfo APIs (#84279)
Admittedly a bit awkward, `visionos` is the correct and accepted
spelling for annotating availability for xrOS target triples. This patch
detects errors and handles cases when `xros` is mistakenly passed.
In addition, add APIs for introduced/deprecated/obsoleted versioning in
DarwinSDKInfo mappings.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 64b234e..dd17941 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1234,8 +1234,11 @@ void Parser::ParseAvailabilityAttribute( } IdentifierLoc *Platform = ParseIdentifierLoc(); if (const IdentifierInfo *const Ident = Platform->Ident) { + // Disallow xrOS for availability attributes. + if (Ident->getName().contains("xrOS") || Ident->getName().contains("xros")) + Diag(Platform->Loc, diag::warn_availability_unknown_platform) << Ident; // Canonicalize platform name from "macosx" to "macos". - if (Ident->getName() == "macosx") + else if (Ident->getName() == "macosx") Platform->Ident = PP.getIdentifierInfo("macos"); // Canonicalize platform name from "macosx_app_extension" to // "macos_app_extension". |