Skip to content

Commit f6a4d42

Browse files
aschwaighofertkremenek
authored andcommitted
[ClangImporter] Update AvailAttr import for "macosx" to "macos" rename. (#3476)
This resolves a number of failing tests caused by availability attributes not getting imported for macOS. (cherry picked from commit 4b566df)
1 parent 1520d7b commit f6a4d42

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
@@ -6199,11 +6199,11 @@ void ClangImporter::Implementation::importAttributes(
61996199
auto platformK =
62006200
llvm::StringSwitch<Optional<PlatformKind>>(Platform)
62016201
.Case("ios", PlatformKind::iOS)
6202-
.Case("macosx", PlatformKind::OSX)
6202+
.Case("macos", PlatformKind::OSX)
62036203
.Case("tvos", PlatformKind::tvOS)
62046204
.Case("watchos", PlatformKind::watchOS)
62056205
.Case("ios_app_extension", PlatformKind::iOSApplicationExtension)
6206-
.Case("macosx_app_extension",
6206+
.Case("macos_app_extension",
62076207
PlatformKind::OSXApplicationExtension)
62086208
.Case("tvos_app_extension",
62096209
PlatformKind::tvOSApplicationExtension)

0 commit comments

Comments
 (0)