diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index e94d7b93f71..b4a5a9b27da 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -222,7 +222,7 @@ static Optional<Visibility> getVisibilityOf(const NamedDecl *D, // implies visibility(default). if (D->getASTContext().getTargetInfo().getTriple().isOSDarwin()) { for (const auto *A : D->specific_attrs<AvailabilityAttr>()) - if (A->getPlatform()->getName().equals("macosx")) + if (A->getPlatform()->getName().equals("macos")) return DefaultVisibility; } diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 91cc9867aff..63fc265144a 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -141,7 +141,7 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, unsigned Maj, Min, Rev; if (Triple.isMacOSX()) { Triple.getMacOSXVersion(Maj, Min, Rev); - PlatformName = "macosx"; + PlatformName = "macos"; } else { Triple.getOSVersion(Maj, Min, Rev); PlatformName = llvm::Triple::getOSTypeName(Triple.getOS()); diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index be694901b91..b7a253156f2 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -880,6 +880,13 @@ void Parser::ParseAvailabilityAttribute(IdentifierInfo &Availability, return; } IdentifierLoc *Platform = ParseIdentifierLoc(); + // Canonicalize platform name from "macosx" to "macos". + if (Platform->Ident && Platform->Ident->getName() == "macosx") + Platform->Ident = PP.getIdentifierInfo("macos"); + // Canonicalize platform name from "macosx_app_extension" to + // "macos_app_extension". + if (Platform->Ident && Platform->Ident->getName() == "macosx_app_extension") + Platform->Ident = PP.getIdentifierInfo("macos_app_extension"); // Parse the ',' following the platform name. if (ExpectAndConsume(tok::comma)) { |