Skip to content

Commit 7b4af34

Browse files
committed
ClangImporter: Adopt new AvailableAttr constructor.
1 parent 86ea1ae commit 7b4af34

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8938,9 +8938,9 @@ void ClangImporter::Implementation::importAttributes(
89388938
continue;
89398939

89408940
// Is this declaration marked platform-agnostically unavailable?
8941-
auto PlatformAgnostic = PlatformAgnosticAvailabilityKind::None;
8941+
auto AttrKind = AvailableAttr::Kind::Default;
89428942
if (avail->getUnavailable()) {
8943-
PlatformAgnostic = PlatformAgnosticAvailabilityKind::Unavailable;
8943+
AttrKind = AvailableAttr::Kind::Unavailable;
89448944
AnyUnavailable = true;
89458945
}
89468946

@@ -8950,14 +8950,13 @@ void ClangImporter::Implementation::importAttributes(
89508950
avail->getLoc(), "__SPI_AVAILABLE");
89518951

89528952
StringRef message = avail->getMessage();
8953-
89548953
llvm::VersionTuple deprecated = avail->getDeprecated();
89558954

89568955
if (!deprecated.empty()) {
89578956
if (platformAvailability.treatDeprecatedAsUnavailable(
89588957
ClangDecl, deprecated, isAsync)) {
8958+
AttrKind = AvailableAttr::Kind::Unavailable;
89598959
AnyUnavailable = true;
8960-
PlatformAgnostic = PlatformAgnosticAvailabilityKind::Unavailable;
89618960
if (message.empty()) {
89628961
if (isAsync) {
89638962
message =
@@ -8978,11 +8977,12 @@ void ClangImporter::Implementation::importAttributes(
89788977
if (!replacement.empty())
89798978
swiftReplacement = getSwiftNameFromClangName(replacement);
89808979

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);
89868986

89878987
MappedDecl->getAttrs().add(AvAttr);
89888988
}

0 commit comments

Comments
 (0)