@@ -3219,7 +3219,7 @@ namespace {
32193219 // Don't import unavailable fields that have no associated storage.
32203220 // TODO: is there any way we could bail here before we allocate/construct
32213221 // the VarDecl?
3222- if (result->getAttrs (). isUnavailable (Impl. SwiftContext ))
3222+ if (result->isUnavailable ())
32233223 return nullptr ;
32243224
32253225 return result;
@@ -6296,7 +6296,7 @@ Decl *SwiftDeclConverter::importEnumCase(const clang::EnumConstantDecl *decl,
62966296
62976297 // If the correct declaration was unavailable, don't map to it.
62986298 // FIXME: This eliminates spurious errors, but affects QoI.
6299- if (correctCase->getAttrs (). isUnavailable (Impl. SwiftContext ))
6299+ if (correctCase->isUnavailable ())
63006300 return nullptr ;
63016301
63026302 auto compatibilityCase =
@@ -6358,7 +6358,7 @@ SwiftDeclConverter::importOptionConstant(const clang::EnumConstantDecl *decl,
63586358 // not operate as a set-like member. Mark them unavailable with a message
63596359 // that says that they should be used as [].
63606360 if (decl->getInitVal () == 0 && !nameInfo.hasCustomName () &&
6361- !CD->getAttrs (). isUnavailable (Impl. SwiftContext )) {
6361+ !CD->isUnavailable ()) {
63626362 // / Create an AvailableAttr that indicates specific availability
63636363 // / for all platforms.
63646364 auto attr = AvailableAttr::createPlatformAgnostic (
@@ -6835,8 +6835,7 @@ bool SwiftDeclConverter::existingConstructorIsWorse(
68356835
68366836 // If one constructor is unavailable in Swift and the other is
68376837 // not, keep the available one.
6838- bool existingIsUnavailable =
6839- existingCtor->getAttrs ().isUnavailable (Impl.SwiftContext );
6838+ bool existingIsUnavailable = existingCtor->isUnavailable ();
68406839 bool newIsUnavailable = Impl.isUnavailableInSwift (objcMethod);
68416840 if (existingIsUnavailable != newIsUnavailable)
68426841 return existingIsUnavailable;
@@ -6951,9 +6950,7 @@ ConstructorDecl *SwiftDeclConverter::importConstructor(
69516950 ctors = found->second ;
69526951
69536952 for (auto ctor : ctors) {
6954- if (ctor->isInvalid () ||
6955- ctor->getAttrs ().isUnavailable (Impl.SwiftContext ) ||
6956- !ctor->getClangDecl ())
6953+ if (ctor->isInvalid () || ctor->isUnavailable () || !ctor->getClangDecl ())
69576954 continue ;
69586955
69596956 // If the types don't match, this is a different constructor with
@@ -7358,7 +7355,7 @@ SwiftDeclConverter::importSubscript(Decl *decl,
73587355
73597356 // Local function to mark the setter unavailable.
73607357 auto makeSetterUnavailable = [&] {
7361- if (setter && !setter->getAttrs (). isUnavailable (Impl. SwiftContext ))
7358+ if (setter && !setter->isUnavailable ())
73627359 Impl.markUnavailable (setter, " use subscripting" );
73637360 };
73647361
@@ -7503,7 +7500,7 @@ SwiftDeclConverter::importSubscript(Decl *decl,
75037500 Impl.Subscripts [{getter, nullptr }] = subscript;
75047501
75057502 // Make the getter/setter methods unavailable.
7506- if (!getter->getAttrs (). isUnavailable (Impl. SwiftContext ))
7503+ if (!getter->isUnavailable ())
75077504 Impl.markUnavailable (getter, " use subscripting" );
75087505 makeSetterUnavailable ();
75097506
@@ -8571,7 +8568,7 @@ void ClangImporter::Implementation::importAttributes(
85718568
85728569 // Scan through Clang attributes and map them onto Swift
85738570 // equivalents.
8574- bool AnyUnavailable = MappedDecl->getAttrs (). isUnavailable (C );
8571+ bool AnyUnavailable = MappedDecl->isUnavailable ();
85758572 for (clang::NamedDecl::attr_iterator AI = ClangDecl->attr_begin (),
85768573 AE = ClangDecl->attr_end (); AI != AE; ++AI) {
85778574 //
0 commit comments