@@ -419,27 +419,27 @@ void DeclAttributes::dump(const Decl *D) const {
419
419
// / introduction version and does not support deprecation, obsoletion, or
420
420
// / messages.
421
421
LLVM_READONLY
422
- static bool isShortAvailable (const SemanticAvailableAttr &semanticAttr ) {
423
- auto *AvailAttr = semanticAttr .getParsedAttr ();
424
- if (AvailAttr ->isSPI ())
422
+ static bool isShortAvailable (const SemanticAvailableAttr &attr ) {
423
+ auto parsedAttr = attr .getParsedAttr ();
424
+ if (parsedAttr ->isSPI ())
425
425
return false ;
426
426
427
- if (!AvailAttr-> Introduced .has_value ())
427
+ if (!attr. getIntroduced () .has_value ())
428
428
return false ;
429
429
430
- if (AvailAttr-> Deprecated .has_value ())
430
+ if (attr. getDeprecated () .has_value ())
431
431
return false ;
432
432
433
- if (AvailAttr-> Obsoleted .has_value ())
433
+ if (attr. getObsoleted () .has_value ())
434
434
return false ;
435
435
436
- if (!AvailAttr-> Message .empty ())
436
+ if (!attr. getMessage () .empty ())
437
437
return false ;
438
438
439
- if (!AvailAttr-> Rename .empty ())
439
+ if (!attr. getRename () .empty ())
440
440
return false ;
441
441
442
- switch (AvailAttr ->getPlatformAgnosticAvailability ()) {
442
+ switch (parsedAttr ->getPlatformAgnosticAvailability ()) {
443
443
case PlatformAgnosticAvailabilityKind::Deprecated:
444
444
case PlatformAgnosticAvailabilityKind::Unavailable:
445
445
case PlatformAgnosticAvailabilityKind::UnavailableInSwift:
@@ -939,40 +939,39 @@ SemanticAvailableAttributes::Filter::operator()(
939
939
return *semanticAttr;
940
940
}
941
941
942
- static void printAvailableAttr (const Decl *D,
943
- const SemanticAvailableAttr &SemanticAttr,
942
+ static void printAvailableAttr (const Decl *D, const SemanticAvailableAttr &Attr,
944
943
ASTPrinter &Printer,
945
944
const PrintOptions &Options) {
946
- auto Attr = SemanticAttr .getParsedAttr ();
947
- auto Domain = SemanticAttr .getDomain ();
945
+ auto ParsedAttr = Attr .getParsedAttr ();
946
+ auto Domain = Attr .getDomain ();
948
947
949
948
// The parser rejects `@available(swift, unavailable)`, so when printing
950
949
// attributes that are universally unavailable in Swift, we must print them
951
950
// as universally unavailable instead.
952
951
// FIXME: Reconsider this, it's a weird special case.
953
- if (Domain.isSwiftLanguage () && Attr-> isUnconditionallyUnavailable ())
952
+ if (Domain.isSwiftLanguage () && Attr. isUnconditionallyUnavailable ())
954
953
Printer << " *" ;
955
954
else
956
955
Printer << Domain.getNameForAttributePrinting ();
957
956
958
- if (Attr-> isUnconditionallyUnavailable ())
957
+ if (Attr. isUnconditionallyUnavailable ())
959
958
Printer << " , unavailable" ;
960
- else if (Attr-> isUnconditionallyDeprecated ())
959
+ else if (Attr. isUnconditionallyDeprecated ())
961
960
Printer << " , deprecated" ;
962
- else if (Attr-> isNoAsync ())
961
+ else if (Attr. isNoAsync ())
963
962
Printer << " , noasync" ;
964
963
965
- if (Attr-> Introduced )
966
- Printer << " , introduced: " << Attr-> Introduced .value ().getAsString ();
967
- if (Attr-> Deprecated )
968
- Printer << " , deprecated: " << Attr-> Deprecated .value ().getAsString ();
969
- if (Attr-> Obsoleted )
970
- Printer << " , obsoleted: " << Attr-> Obsoleted .value ().getAsString ();
964
+ if (Attr. getIntroduced () )
965
+ Printer << " , introduced: " << Attr. getIntroduced () .value ().getAsString ();
966
+ if (Attr. getDeprecated () )
967
+ Printer << " , deprecated: " << Attr. getDeprecated () .value ().getAsString ();
968
+ if (Attr. getObsoleted () )
969
+ Printer << " , obsoleted: " << Attr. getObsoleted () .value ().getAsString ();
971
970
972
- if (!Attr-> Rename .empty ()) {
973
- Printer << " , renamed: \" " << Attr-> Rename << " \" " ;
971
+ if (!Attr. getRename () .empty ()) {
972
+ Printer << " , renamed: \" " << Attr. getRename () << " \" " ;
974
973
} else if (auto *VD = dyn_cast<ValueDecl>(D)) {
975
- if (auto *renamedDecl = VD->getRenamedDecl (Attr )) {
974
+ if (auto *renamedDecl = VD->getRenamedDecl (ParsedAttr )) {
976
975
Printer << " , renamed: \" " ;
977
976
if (auto *Accessor = dyn_cast<AccessorDecl>(renamedDecl)) {
978
977
SmallString<32 > Name;
@@ -989,10 +988,10 @@ static void printAvailableAttr(const Decl *D,
989
988
// If there's no message, but this is specifically an imported
990
989
// "unavailable in Swift" attribute, synthesize a message to look good in
991
990
// the generated interface.
992
- if (!Attr-> Message .empty ()) {
991
+ if (!Attr. getMessage () .empty ()) {
993
992
Printer << " , message: " ;
994
- Printer.printEscapedStringLiteral (Attr-> Message );
995
- } else if (Domain.isSwiftLanguage () && Attr-> isUnconditionallyUnavailable ())
993
+ Printer.printEscapedStringLiteral (Attr. getMessage () );
994
+ } else if (Domain.isSwiftLanguage () && Attr. isUnconditionallyUnavailable ())
996
995
Printer << " , message: \" Not available in Swift\" " ;
997
996
}
998
997
0 commit comments