@@ -8938,9 +8938,9 @@ void ClangImporter::Implementation::importAttributes(
8938
8938
continue ;
8939
8939
8940
8940
// Is this declaration marked platform-agnostically unavailable?
8941
- auto PlatformAgnostic = PlatformAgnosticAvailabilityKind::None ;
8941
+ auto AttrKind = AvailableAttr::Kind::Default ;
8942
8942
if (avail->getUnavailable ()) {
8943
- PlatformAgnostic = PlatformAgnosticAvailabilityKind ::Unavailable;
8943
+ AttrKind = AvailableAttr::Kind ::Unavailable;
8944
8944
AnyUnavailable = true ;
8945
8945
}
8946
8946
@@ -8950,14 +8950,13 @@ void ClangImporter::Implementation::importAttributes(
8950
8950
avail->getLoc (), " __SPI_AVAILABLE" );
8951
8951
8952
8952
StringRef message = avail->getMessage ();
8953
-
8954
8953
llvm::VersionTuple deprecated = avail->getDeprecated ();
8955
8954
8956
8955
if (!deprecated.empty ()) {
8957
8956
if (platformAvailability.treatDeprecatedAsUnavailable (
8958
8957
ClangDecl, deprecated, isAsync)) {
8958
+ AttrKind = AvailableAttr::Kind::Unavailable;
8959
8959
AnyUnavailable = true ;
8960
- PlatformAgnostic = PlatformAgnosticAvailabilityKind::Unavailable;
8961
8960
if (message.empty ()) {
8962
8961
if (isAsync) {
8963
8962
message =
@@ -8978,11 +8977,12 @@ void ClangImporter::Implementation::importAttributes(
8978
8977
if (!replacement.empty ())
8979
8978
swiftReplacement = getSwiftNameFromClangName (replacement);
8980
8979
8981
- auto AvAttr = new (C) AvailableAttr (
8982
- SourceLoc (), SourceRange (), platformK.value (), message,
8983
- swiftReplacement, introduced, SourceRange (), deprecated,
8984
- SourceRange (), obsoleted, SourceRange (), PlatformAgnostic,
8985
- /* Implicit=*/ false , EnableClangSPI && IsSPI);
8980
+ auto AvAttr = new (C)
8981
+ AvailableAttr (SourceLoc (), SourceRange (),
8982
+ AvailabilityDomain::forPlatform (*platformK), AttrKind,
8983
+ message, swiftReplacement, introduced, SourceRange (),
8984
+ deprecated, SourceRange (), obsoleted, SourceRange (),
8985
+ /* Implicit=*/ false , EnableClangSPI && IsSPI);
8986
8986
8987
8987
MappedDecl->getAttrs ().add (AvAttr);
8988
8988
}
0 commit comments