Skip to content

Commit 9cadb9d

Browse files
committed
[ClangImporter] Update AvailAttr import for "macosx" to "macos" rename.
This resolves a number of failing tests caused by availability attributes not getting imported for macOS. (cherry picked from commit e0489d356a9683c444a118f490949aabd18adb0c) Reapply this cherry-pick; it was accidentally reverted as part of f4d68f6.
1 parent 22ccda1 commit 9cadb9d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,12 +1292,12 @@ ClangImporter::Implementation::Implementation(ASTContext &ctx,
12921292
else if (ctx.LangOpts.Target.isMacOSX()) {
12931293
if (!ctx.LangOpts.EnableAppExtensionRestrictions) {
12941294
PlatformAvailabilityFilter =
1295-
[](StringRef Platform) { return Platform == "macosx"; };
1295+
[](StringRef Platform) { return Platform == "macos"; };
12961296
} else {
12971297
PlatformAvailabilityFilter =
12981298
[](StringRef Platform) {
1299-
return Platform == "macosx" ||
1300-
Platform == "macosx_app_extension"; };
1299+
return Platform == "macos" ||
1300+
Platform == "macos_app_extension"; };
13011301
}
13021302
// Anything deprecated in OSX 10.9.x and earlier is unavailable in Swift.
13031303
DeprecatedAsUnavailableFilter =

lib/ClangImporter/ImportDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6187,11 +6187,11 @@ void ClangImporter::Implementation::importAttributes(
61876187
auto platformK =
61886188
llvm::StringSwitch<Optional<PlatformKind>>(Platform)
61896189
.Case("ios", PlatformKind::iOS)
6190-
.Case("macosx", PlatformKind::OSX)
6190+
.Case("macos", PlatformKind::OSX)
61916191
.Case("tvos", PlatformKind::tvOS)
61926192
.Case("watchos", PlatformKind::watchOS)
61936193
.Case("ios_app_extension", PlatformKind::iOSApplicationExtension)
6194-
.Case("macosx_app_extension",
6194+
.Case("macos_app_extension",
61956195
PlatformKind::OSXApplicationExtension)
61966196
.Case("tvos_app_extension",
61976197
PlatformKind::tvOSApplicationExtension)

0 commit comments

Comments
 (0)